Created
April 12, 2018 18:58
-
-
Save phpfiddle/624896c8b5028780aa6fede05223e7fd to your computer and use it in GitHub Desktop.
[ Posted by Asgedom ] this code is to display the discount price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//this is a single comment | |
#this is also a single line comment | |
/*this is a multiple | |
line comment | |
*/ | |
//PHP statement end with a semicolon | |
$discount_percent = .20;#comment can be placed after the code 20% | |
$subtotal=100; | |
$discount_amount=$subtotal * $discount_percent; | |
$discount_price=$subtotal - $discount_amount; | |
echo "Your price after discount is :$". $discount_price; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment