Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created April 12, 2018 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/624896c8b5028780aa6fede05223e7fd to your computer and use it in GitHub Desktop.
Save phpfiddle/624896c8b5028780aa6fede05223e7fd to your computer and use it in GitHub Desktop.
[ Posted by Asgedom ] this code is to display the discount price
<?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