I am not able to get a stristr function to come back true, and I believe it is because of a $ character in my search.
When I do:
var_dump($nopricecart);
Where the full $nopricecart value is <span class="pricedisplay">$0</span>, I get:
string(41) “$0”
But when I do:
if(stristr($nopricecart , "$0")){
echo "*";
} else {
echo $nopricecart;
}
I always get the variable of $nopricecart, even when it is $0.
Removing the $ from my if function works perfectly, but this is not going to work for my code.
The
string(41)should give it away: It appears there are a LOT of non-printable characters in your string. Find out where they are coming from and remove them, and your code should work.