TEENFRONT Posted April 12, 2006 Share Posted April 12, 2006 hey, i have a review script that displays info from the db.how do i check if $value and $value exists, and if BOTH OR EITHER exists, display sumthing..atm im cecking if each exisit one by one soif ($var) { display bleh } if ($var2) { display bleh2 } and so on, but i want to check if both or either exist, then display bleh.Does anyone get what i mean lol? sorry if ya dont. Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 12, 2006 Share Posted April 12, 2006 [code] if (($var) || ($var2)) { echo "bleh";}[/code] Quote Link to comment Share on other sites More sharing options...
Barand Posted April 12, 2006 Share Posted April 12, 2006 [code]if ($var1 && $var2) { echo "Both exist";}elseif ($var1 || $var2) { echo "one of them exists";}else { echo "Neither exist";}[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.