Someone on this site needs to fix this page in the documentation. I spent a good half hour trying to figure out what was wrong with my code, when it was really just a misleading example in the documentation.
Its for the quite simple function strpos(). if you look at the doc, the function prototype is:
int strpos (string haystack, string needle [, int offset])
and then, their examples:
1
2 // in PHP 4.0b3 and newer:
3 $pos = strpos ("b", $mystring);
4 if ($pos === false) { // note: three equal signs
5 // not found...
6 }
7
8 // in versions older than 4.0b3:
9 $pos = strpos ("b", $mystring);
10 if (is_string ($pos) && !$pos) {
11 // not found...
12 }
13
Now, I understand this is valid syntax, and that there are technically no errors on the page. However, I doubt anyone is going to be checking for $mystring as a substring of a single character. the parameters are obviously reversed! argh. well, hopefully someone who has control over such things can remedy this.