Sometimes when working strings we need to know if a character or another string is within the string, this below will help.
if (strpos($str, '.') !== FALSE) { echo 'Found it'; } else { echo "nope!"; }
Reference: http://stackoverflow.com/questions/13577041/php-string-contains
You must be logged in to post a comment.