Expressions in PHP

This code gives you a sample of the expressions built with PHP variables and constants.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> VARIABLES ASSIGNMENT </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<?php
$name = "Notebook 192 pages";
$buyingPrice = 21.50;
$profit=$buyingPrice*20/100;
$profitPercentage = 20;
$quantity=1500;
?>

<table>
<tr>
<td>Name</td>
<td>Buying Price</td>
<td>Selling Price</td>
<td>Profit Percentage</td>
<td>Quantity</td>
</tr>
<tr>
<td><?php echo "$name";?></td>
<td><?php echo $buyingPrice?></td>
<td><?php echo $buyingPrice+$profit?></td>
<td><?php echo $profitPercentage?></td>
<td><?php echo $quantity?></td>
</tr>
</BODY>
</HTML>

The output being

Name Buying Price Selling Price Profit Percentage Quantity
Notebook 192 pages 21.5 25.8 20 1500
Advertisements