"strpos issue with 0==false?" Answer’s

0

From http://www.php.net/manual/en/function.strpos.php:

Warning

This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or "". Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.

You have to use the === operator instead of ==.

In your case, instead of using <>, use !==:

strpos($grafik['data'], $ss1) !== false

This will return TRUE if $ss1 is found in $grafik['data']

Wednesday, March 31, 2021
 
Packy
answered 11 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :