Variables - nolenfelten/Codecademy-PHP GitHub Wiki

So far we've been outputting strings and doing math.

To do more complex coding, we need a way to "save" these values. We can do this using variables. A variable can store a string or a number, and gives it a specific case-senstive name.

Examples:

$myName = "Beyonce"; $myAge = 32; All variable names in PHP start with a dollar sign ( $ ).

Instructions On line 8, create a variable named $myName and set it equal to your name. Make sure to end your PHP code with a semicolon.

<!DOCTYPE html>
<html>
	<head>
	</head>
	<body>
		<p>
		  <?php
		  $myName = "Nolen";
		  $myAge = 21;
		  ?>
		</p>
	</body>
</html>
⚠️ **GitHub.com Fallback** ⚠️