Entries tagged with 'else'

Get Paid to Blog About the Things You Love

PHP if statement alternatives

Did you know there are actually 3 different ways to use the if…else…elseif control in PHP? They each have their uses, and hopefully I can help decode them a little bit for those who aren’t familiar with them. Here is your standard if statement:
if ($islocal) {
    $user = “localhost”;
} else {
    $user = $logged_in_user; 

if ($isadmin) [...]