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
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
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
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
4 matches
Mail list logo