RE: [PHP] compare lists
| From: | mayo | Date: | Sun, 18 Jan 2004 18:26:31 +0000 |
| Subject: | RE: [PHP] compare lists | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-174974@lists.php.net to get a copy of this message | ||
thx Richard,
wouldn't you know it, you can look for something, can't find it, post a
question, and then find it?
go figure :-)
thx
-- gil
> -----Original Message-----
> From: Richard Davey [mailto:rich@launchcode.co.uk]
> Sent: Sunday, January 18, 2004 1:26 PM
> To: mayo
> Cc: php-general
> Subject: Re: [PHP] compare lists
>
>
> Hello mayo,
>
> Sunday, January 18, 2004, 6:06:41 PM, you wrote:
>
> m> I would like to compare strings. I'm using this for my navigation
>
> m> IF $title CONTAINS "abc: def"
>
> m> Comparing the number of characters in one string with another
> does not do
> m> the trick. (strcmp)
>
> If I have understood your pseudo code correctly then you're not really
> comparing strings, you're just checking to see if a string contains a
> set of characters (i.e. another string).
>
> There is no reason why you couldn't do:
>
> if (strpos($title, "abc: def") === false)
> {
> // not found
> }
> else
> {
> // do stuff
> }
>
> --
> Best regards,
> Richard
> mailto:rich@launchcode.co.uk
>
>