PHP if statement alternatives
Sunday, September 7th, 2008
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) [...]
























