I use strpos to find the position of a line in another line. First, I check if the string is found there. Here is my line:
if (strpos($grafik['data'],$ss1)<>false && strpos($grafik['data'],$ss2)<>false && strpos($grafik['data'],$ss1) < strpos($grafik['data'],$ss2))
I check if both lines are contained, and then I want the first to be placed before the second. The php manual says strpos returns false when a string is not found. However, if my line starts at position zero (strpos returns 0 from the moment it started), it looks like this statement
strpos($grafik['data'],$ss1)<>false
is false. Somehow 0 == false? How to make a statement true when strpos returns 0?
source
share