Michael wrote:
I'm trying to use stripos as a faster and less resource-intensive alternative to preg_match with the i flag, but I'm getting some strange behavior.
<snip problem description>
AFAIK, stripos should behave exactly like strpos except case-insensitively. So in the function above, it should make absolutely no difference which one I use.
stripos only exists in PHP 5.
Aha. Must have missed that in the docs.
You are probably running PHP 4.
Yes, indeed I am. That would be the problem then.
You also are hiding/re-directing your error messages somewhere, and have not gotten into the habit (yet) of reading the error log.
On this point, however, you're mistaken (not your fault, of course... :) ). I was watching tail -f php_error_log as I was diagnosing the problem. I've written a custom error handler, however, which may not be handling PHP-generated errors correctly (although it does deal with syntax errors, for instance). So I'm not sure what the issue is there. But that's less important.
Thanks very much for your help!
Mike
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php