php_contorol_method
last update:
2013/02/01
// switch
---
<?php
switch($foo) {
case "bar":
$bar1 = 'qux1';
$bar2 = 'qux2';
break;
case "baz":
$baz1 = 'quxx1';
$baz2 = 'quxx2';
break;
}
?>
code_popup
---
<?php
switch($foo) {
case "bar":
?>
<?php
break;
case "baz":
?>
<?php
break;
}
?>
code_popup
// if
---
<?php
if ($foo) {
} elseif ($bar) {
} else {
}
?>
code_popup
---
<?php
if ($foo) {
?>
<?php
} elseif ($bar) {
?>
<?php
} else {
?>
<?php
}
?>
code_popup
// for
---
<?php
for($i = 1; $i <= 42; $i++) {
}
?>
code_popup
---
<?php
for($i = 1; $i <= 42; $i++) {
?>
<?php
}
?>
code_popup
// isset
---
<?php
if (isset($_GET["param_01"])) {
} else if (isset($_GET["param_02"])) {
} else if (isset($_GET["param_03"])) {
}
?>
code_popup
---
<?php
if (isset($_GET["param_01"])) {
?>
<?php
} else if (isset($_GET["param_02"])) {
?>
<?php
} else if (isset($_GET["param_03"])) {
?>
<?php
}
?>
code_popup