[PHP] Comparing strings

2001-11-01 Thread phantom
Bear with me, new to PHP and got a beginner's questions How do I run an if statement and the if statement compares a String? IN ASP (yes I Know, ASP is evil) I would have wrote if (String(Request("Action"))=="Submit") do this In PHP I have tried if ($Action == "Submit") but I get a par

Re: [PHP] Comparing strings

2001-11-01 Thread Michael Egan
I feel fairly new to this as well but I think that, whilst your logic is right, the syntax may be a little off. if ($action == "textstring) { echo "true"; } else { echo "false"; } Above should show how the syntax will rok. Good luck Michael phantom wrote: > > Bear with me, new to PHP and g

[PHP] comparing strings does not work

2002-06-11 Thread andy
Hi there, I would like to compare 2 strings. I do always get a 0 return (not equal) but they are difinatelly equal, I double checked it. They are just in two different vars. Here is how I did it: if (strcmp($city, $city_new) != 0) $error = true; Does anybody see the error? Or am I going the

RE: [PHP] comparing strings does not work

2002-06-11 Thread Jonathan Rosenberg
strcmp returns 0 if the two strings are equal. In any case, why not just do if ($city == $city_new) $error = true; > -Original Message- > From: andy [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 9:10 AM > To: [EMAIL PROTECTED] > Subject: [PHP] compari