I'm trying to find a string inside a variable. The problem is that it doesn't look for a unique string.
For example, a have a variable with the following values:
$mystring = "p,pp,m,g";
Here's the code that I'm using:
<?php
$find="pp";
if(strstr($mystring, $find)==true){
echo "found";
}
?>
The problem is: when I'm looking for pp, it also returns "p" as a result.
How can I avoid this kind of error?
I'm using it to check the sizes of a item on an ecommerce website and I'm struggling to get it right.
Any ideas?!
strstr($mystring, $find) == true.