Embedded Conditionals : String Interpolation « String « PHP
- PHP
- String
- String Interpolation
Embedded Conditionals
<?php
$value = 2;
if($value > 0) {
if($value <= 10) {
echo 'The $value variable is between 1 and 10.';
} else {
if($value <= 20) {
echo 'The $value variable is between 1 and 20.';
} else {
echo 'The $value variable is greater than 20';
}
}
}
?>
Related examples in the same category