PHP: strrpos() vs strpos()
I normally wouldn't post about such trivial matters, however this particular trivial matter bugged me for several hours this afternoon, so I thought I mention it.
It seems that one of the problems of coding on a development server that runs PHP 5 for a production server that runs PHP 4 is the subtle differences in the language. These subtle differences can really throw a spanner in the works [like one did to me this afternoon.]
Basically my development code used the strrpos() function to attempt to find the first occurrence of a string within a string. While this worked just fine with PHP 5, it bombed big time with PHP 4 [which will only find the first occurrence of a single character.] Apparently I should have been using the strpos() function instead!
Oh well, live and learn.

Add Your Comment
Use the form below to add your comment. Markdown syntax is available. Note, comments are moderated by me for spam filtering. Alternatively, feel free to contact me privately.