I've got a string called $Utilities. In this example, the word "Gas" is first in the string. When I use the strpos() function to check for "Gas" in the string, it isn't found. Basically, whatever is first in the string is not found, but the rest of the words are. I'm trying to select the checkboxes of the items that are in the string.
This is what I currently have that is not working:
<?
if (strpos($Utilities, "Gas", 0)) {
echo "checked";
}
?>
I have also tried:
strpos($Utilities, "Gas")
and
if (strpos($Utilities, "Gas") === true) { ...
and
if (strpos($Utilities, "Gas") == true) { ...
None of those options work either. Is there another function that would work better?