Forum Moderators: coopster
When I run the following code on Apache on Windows:
$string = "<body><new></new><tr><td>dfdfdfdfdf</td></tr><content>Sdsdfdfdfd</content></body>";print strrpos($string,"</tr>");
It returns 40.
But when I run the same code on IIS on Windows it returns 74. The problem is due to the / with tr.
I tried using // and \/ to escape but didn't work. How do I make it work?
Thanks
Strrpos in PHP4 only takes a single character to search for, not a string. If you enter a string it'll just search for the first character of that string. Which in your example is '<' which is at position 74.
To get it to work upgrade to PHP5 or use something different to strrpos.