I'm new to PHP and am trying some samples from a tutorial. In particular, the following:
<?php
$price = 3.95;
$tax_rate = 0.08;
$tax_amount = $price * $tax_rate;
$total_cost = $price + $tax_amount;
$username = 'james';
$domain = '@example.com';
$email_address = $username . $domain;
print 'The tax is ' . $tax_amount;
print "\n"; // this prints a linebreak
print 'The total cost is ' .$total_cost;
print "\n"; // this prints a linebreak
print $email_address;
?>
Previewing this file in my browser prints everything on one line, but when I view the source page, it shows the linebreaks working properly. I'm a bit confused as to why it doesn't format properly in the browser.