Multiple statements in an if() code block : If statement « Statement « PHP
- PHP
- Statement
- If statement
Multiple statements in an if() code block
<?
print "This is always printed.";
$logged_in = true;
if ($logged_in) {
print "Welcome aboard, trusted user.";
print 'This is only printed if $logged_in is true.';
}
print "This is also always printed.";
?>
Related examples in the same category