[UPHPU] More if then fun...

Steve Dibb sdibb at wonkabar.org
Wed Apr 28 13:32:49 MDT 2004


if ( ($k == "Website" || $k == "Email_Address") && $text !="")

> -------- Original Message --------
> Subject: [UPHPU] More if then fun...
> From: "Ashley Oviatt" <ashovi at qwest.net>
> Date: Wed, April 28, 2004 11:04 am
> To: 
> Cc: "UPHPU List" <list at uphpu.org>
> 
> Can someone explain to me why the first if statement works (doesn't 
> produce the output,) and the second one doesn't work (Does produce the
> 
> output)?
> 
> I'm assuming the syntax of the second if statement is wrong, but I
> don't 
> know why.
> 
> <?php
> 	$text = "";	
> 	$k = "Website";
> 
> // First if statement
> 	if ($k == "Websites" || $k == "Email_Address")
> 	{
>          if ($text !="")
> 		{
> 		print "hello I am the first test";
> 		}
> 	}
> 
> //Second if statement.
> 	if ($k == "Website" || $k == "Email_Address" && $text !="")
> 
> 		{
> 		print "hello I am the second test";
> 		}
> ?>
> 
> 
> The output of the code is : hello I am the second test
> 
> ???
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: list-unsubscribe at uphpu.org
> For additional commands, e-mail: list-help at uphpu.org



More information about the UPHPU mailing list