Hi
I have just started to learn PHP and I encountered the problem: I type in this code :
[COLOR=“Red”]<?php # Script 1.11 - quotes.php
// Set the variables.
$quantity = 30; // Buying 30 widgets.
$price = 119.95;
$taxrate = .05; // 5% sales tax.
// Calculate the total.
$total = $quantity * $price;
$total = $total + ($total * $taxrate); // Calculate and add the tax.
$total = number_format ($total, 2);
// Print the results.
echo ‘Using double quotation marks:<br />’;
echo "You are purchasing <b>$quantity</b> widget(s) at a cost of <b>\$$price</b> each. With tax, the total comes to <b>\$$total</b>.
";
echo ‘<p><hr /></p>Using single quotation marks:<br />’;
echo 'You are purchasing <b>$quantity</b> widget(s) at a cost of <b>\$$price</b> each. With tax, the total comes to <b>\$$total</b>.
';
?>[/COLOR]
My Output:
[COLOR=“RoyalBlue”]'; echo "You are purchasing $quantity widget(s) at a cost of \$$price each. With tax, the total comes to \$$total.
"; echo ’
Using single quotation marks:
'; echo 'You are purchasing $quantity widget(s) at a cost of \$$price each. With tax, the total comes to \$$total.
'; ?> [/COLOR]
Someone help please, Why is the echo word being printed and variables not being printed.