RE: [PHP] Re: strpos From: Andrew Kirilenko (icedank <email protected>)
Date: 11/16/01

Hello!

if (!strpos(...))
will be better...

Best regards,
Andrew Kirilenko.

> -----Original Message-----
> From: Martin Thoma [mailto:martin <email protected>]
> Sent: Friday, November 16, 2001 9:28 AM
> To: php-general <email protected>
> Subject: [PHP] Re: strpos
>
>
> strpos return false if the search fails. You have therefore to test for:
>
> if (strpos(...,...) === false)
>
> or
>
> if (strpos(...,...) !== false)
>
> Martin
>
>
> Jtjohnston wrote:
>
> > I suppose I'm doing this right? I want to know if the user entered
> > "\.jpeg" or "\.jpg". If he didn't, it should error.
> >
> > It errors anyways? What do I have to do add slashes in my <input>???
> > :o)
> >
> > // if((!strpos($yourimage, "\.jpg")) || (!strpos($yourimage,
> > "\.jpeg"))) \\ <--- tried both!
> > if((!strpos($yourimage, ".jpg")) || (!strpos($yourimage, ".jpeg")))
> > {
> > error_found("error found");
> > $errorfound++;
> > }
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>