Date: 12/21/99
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2986 Updated: Apache crashes when compiling php4/mod_perl-1.21 monolithically."
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2989 Updated: Expired in header"
- Next in thread: rasmus <email protected>: "Re: [PHP-DEV] Re: PHP 4.0 Bug #3017 Updated: if(strpos("Mozilla/4.7", "Mozilla") evaluates false!!!"
- Reply: rasmus <email protected>: "Re: [PHP-DEV] Re: PHP 4.0 Bug #3017 Updated: if(strpos("Mozilla/4.7", "Mozilla") evaluates false!!!"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] Re: PHP 4.0 Bug #3017 Updated: if(strpos("Mozilla/4.7", "Mozilla") evaluates false!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
thank you for the fast response. however the function still does not
behave as one would expect.
that strpos("Mozilla/4.7", "Mozilla") is 0 should not mean that it's not
found, instead should mean that it's found right on the 0th position,
and therefore in an if-clause should evaluate to true.
i know there are many workarounds to this problem, like
if (substr($uagent, 0, 7) == "Mozilla)) {
or
if (strpos($uagent, "ozilla") == 1 ) {
etc, etc
yet the strpos function still does not behave as expected, ie return -1
if not found as in the other languages, say C/C++, Java, JavaScript,
Perl, to name a few giants.
thank you anyway,
regards,
cuneyt yilmaz
Bug Database wrote:
>
> ID: 3017
> Updated by: andrei
> Reported By: cu <email protected>
> Status: Closed
> Bug Type: Misbehaving function
> Assigned To:
> Comments:
>
> Instead try this:
>
> if (strpos($uagent, "Mozilla") === false) to compare against
> the real false value.
>
> Full Bug description available at: http://bugs.php.net/version4/?id=3017
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2986 Updated: Apache crashes when compiling php4/mod_perl-1.21 monolithically."
- Previous message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #2989 Updated: Expired in header"
- Next in thread: rasmus <email protected>: "Re: [PHP-DEV] Re: PHP 4.0 Bug #3017 Updated: if(strpos("Mozilla/4.7", "Mozilla") evaluates false!!!"
- Reply: rasmus <email protected>: "Re: [PHP-DEV] Re: PHP 4.0 Bug #3017 Updated: if(strpos("Mozilla/4.7", "Mozilla") evaluates false!!!"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] Re: PHP 4.0 Bug #3017 Updated: if(strpos("Mozilla/4.7", "Mozilla") evaluates false!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

