Re: compare lists

From: Date: Sun, 18 Jan 2004 18:26:14 +0000
Subject: Re: compare lists
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-174972@lists.php.net to get a copy of this message
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

« previous php.general (#174972) next »