More if then fun...

Ashley Oviatt ashovi at qwest.net
Wed Apr 28 12:04:35 MDT 2004


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

???




More information about the UPHPU mailing list