You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

Logical Operand will not echo()

They have: 21 posts

Joined: Dec 2008

I have uploaded the changes to the code and still it will not echo?

<?php
    $a
= true;
   
$b = false;
   
   
#test both operands for true (&& = and)
   
$test1 = ($a and $a)? "true":"false";
   
$test2 = ($a and $b)? "true":"false";
   
$test3 = ($b and $b)? "true":"false";
   
   
#test either operand for TRUE (|| = or)
   
$test4 = ($a or $a)? "true":"false";
   
$test5 = ($a or $b)? "true":"false";
   
$test6 = ($b or $b)? "true":"false";
   
   
#test for single operand is TRUE
   
$test7 = ($a xor $a)? "true":"false";
   
$test8 = ($a xor $b)? "true":"false";
   
$test9 = ($b xor &b)? "true":"false";
   
   
#invert values ( ! = NOT )
   
$test10 = ( !$a )? "true":"false";
   
$test11 = ( !$b )? "true":"false";
   
   
$result  = "AND Operand - 1:$test1 2:$test2 3:$test3<br/><br/>";
   
$result .= "OR Operand - 1:$test4 2:$test5 3:$test6<br/><br/>";
   
$result .= "XOR Operand - 1:$test7 2:$test8 3:$test9<br/><br/>";
   
$result .= "NOT Operand - 1:$test10 2:$test11";
   
?>

Untitled Document

<?php
 
echo($result);
?>

Thanks

He has: 670 posts

Joined: Jul 2005

This problem has already been resolved in a different post.