Basic PHP – Assigning Values to Variables
Adding values to php variables is simple as the following examples shows
<?php $name = "Bobby"; $age = "30"; ?>
The example code above will add the value Bobby to the variable $name and 30 to the variable age. You can print the value of the variable out to the browser by using the echo statement as follows.
<?php echo $bobby; ?>
Further to this we could add this html to a page.
Hi my name is <?php echo $name;?> and my age is <?php echo $age;?>
This will print out Hi my name is Bobby and my age is 30






Latest from Twitter