Tutorial 3: More Variables


Here are some more basic variables:

<?php
	$my_name = "Brad";
	
	$my_age = 25;
	
	$fav_colour = "Blue";
?>

If I want to display these variables on the page in some meaningful way, I could use the PHP Print Function:

<?php
print("My name is $my_name! 
I'm $my_age years old, and like the colour $fav_colour."); ?>

PHP will spit out the following phrase:

My name is Brad!
I'm 25 years old, and like the colour Blue.