PHP - Variables


variables.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>variables.php</title>
</head>

<body>
<?php
$student
="Julio Garcia";
Print(
$student);
?>
</body>
</html>

variables2.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>variables2.php</title>
</head>

<body>
<?php
$number1
=10;
$number2=15;
$number3=5;

$total=$number1+$number2+$number3;

print(
"<p>The sum of the numbers is ".$total."</p>");

print(
"I have ".($number1+$number2+$number3)." dollars!");

?>

</body>
</html>