v.2.5 Contains function info

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 14, 2013   (RSS)

Saw that the new 2.5 release of CMSBuilder sports a "contains" function. Are there any docs or examples of this floating around that I've missed?

Cheers,
J.

Hi J,

There isn't any documentation for this function yet. Here is an example of how you could use it:


$email = 'greg@interactivetools.com';


if(contains('@',$email)){
  echo 'true';
}else{
  echo 'false';
}

The function can be used to check if a string contains another string, and it will return a boolian of true or false

The above function would echo true as the $email string does contain an @ symbol, but if you chaned the $email variable to 'greg' it would return false.

Thanks

Greg

Greg Thomas







PHP Programmer - interactivetools.com

Many thanks Greg!  I think this means that this function can not be used to detect whether a mutli-list (checkbox, radiobox, list) pulled from a record in CMSB contains certain values. 
i.e.: a multi-list has had some values checked/present but not others.

Is that correct?

Thank you Greg. That's exceptionally helpful. I really appreciate you going through the "what if" process in your response.

Be well!