You are here: Re: [PHP] stripos kills my script but strpos is fine? « PHP « IT news, forums, messages
Re: [PHP] stripos kills my script but strpos is fine?

Posted by Michael on 10/03/83 11:07

Richard Lynch wrote:
> 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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация