PHP Embedded Conditionals – String Function

<?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';
            }        }
    }?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.