Jump to content

Archived

This topic is now archived and is closed to further replies.

TEENFRONT

if $value & $value

Recommended Posts

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 so

if ($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.

Share this post


Link to post
Share on other sites
[code] if (($var) || ($var2)) {
    echo "bleh";
}[/code]

Share this post


Link to post
Share on other sites
[code]if ($var1 && $var2) {

         echo "Both exist";

}

elseif ($var1 || $var2) {

         echo "one of them exists";

}

else {

       echo "Neither exist";
}[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.