Also keep in mind that sometimes spaces find their ways into the string
and using trim() will get rid of them.  Something like :

  if (strcasecmp('neo',trim($name)) == 0) {

    echo 'You chose our Neo line of goods, way to go!';
  }

Not to say spaces randomly attach to strings :-) but to be safe, I'm
usually a trim freak.  I Love to trim!

Regards,
Philip



On Tue, 7 Aug 2001, Don Read wrote:

> 
> On 07-Aug-2001 Bjorn Van Simaeys wrote:
> > Hi,
> > 
> > I have run accross this problem too, and I solve it
> > this way:
> > 
> > if(strtolower($name1) == strtolower($name2))
> > 
> > I compare both variables in lower case, this way
> > capitals don't matter at all.
> > 
> > 
> 
> if (0 == strcasecmp('neo', $name))   // why didn't the call this stricmp ?
>     echo 'matched';
> 
> if eregi('^neo$', $name)
>     echo 'matched also';
> 
> Regards,
> -- 
> Don Read                                       [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to 
>    steal the neighbor's newspaper, that's the time to do it.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to