• 10Nov

    By using logical operators we can compare numbers in the if statements to determine the truth of certain comparisons. Is one equal to one? Hopefully so.
    Number Comparison
    You need flash to play this tutorial.
    This tutorial goes over the following goals:
    Working with numbers
    Comparing Number
    Doing a discount
    You can find this tutorial video on youtube here.

    Here are the sources used in this tutorial:
    tut004.php
    <?php
    $tires = 4;
    
    $discountAfter = 150;
    
    $cost =40*$tires;
    echo "currently: $cost. ";
    
    if($cost >= $discountAfter){
    	$cost = 0.95*$cost;
    
    	echo "Congrats you get a 5% discount, and your new total is $cost!";
    }
    ?>

    Here are all the php functions used in this tutorial:

    Posted by Kloplop321 @ 12:07 pm

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.