Skip to content

Arithmetic

Nolen Felten edited this page Feb 4, 2016 · 1 revision

In addition to outputting strings, PHP can also do math. Here we use echo to multiply 5 and 7, and we end our line of code with a semicolon. PHP will output 35.

Instructions On line 8 in between the , use echo to calculate 17 * 123. Make sure to end your PHP code with a semicolon.

<!DOCTYPE html>
<html>
	<head>
	</head>
	<body>
		<p>
		  <?php
			echo 17 * 123;   
		  ?>
		</p>
	</body>
</html>
Clone this wiki locally