Re: Comparing strings

From: Date: Thu, 01 Nov 2001 10:50:55 +0000
Subject: Re: Comparing strings
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-73131@lists.php.net to get a copy of this message
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 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 parse error in that statement. > What am I doing wrong? Thank you. I did an echo $Action to confirm > that it's value is Submit. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#73131) next »