[PHP] beginner code help

2001-09-07 Thread Nikola Veber

Hi !

Can anyone tell me why this line returns the parse error

if (strstr($name, firstname) or strstr($ime, lastname)){
}

With this line I'd like to determine if string $name , which contains both first and 
last name, has earlier defined first and last name, with no difference of the 
order(name is first, surname last or oposite).
Can anyone tell me how to compare string values in non-case sensitive way(with 
no difference between upper and lower case characters Name == name)


-- 
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]




Re: [PHP] beginner code help

2001-09-07 Thread Rasmus Lerdorf

There is no parse error in this code.  Check the line before that one.
And see stristr(), strcasecmp() and strtolower() for ways to do case
independant comparisons.

-Rasmus

On Fri, 7 Sep 2001, Nikola Veber wrote:

 Hi !

 Can anyone tell me why this line returns the parse error

 if (strstr($name, firstname) or strstr($ime, lastname)){
 }

 With this line I'd like to determine if string $name , which contains both first and
 last name, has earlier defined first and last name, with no difference of the
 order(name is first, surname last or oposite).
 Can anyone tell me how to compare string values in non-case sensitive way(with
 no difference between upper and lower case characters Name == name)





-- 
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]