Welcome to Our Free Tutorial!

PHP-PHP Echo Variables!

Previous Home Next

Using Echo Variables!

Echo variable is very easy to use, there are no required quotations. Below the correct format of Echo Variables.

PHP Code
<?php
$aone_string = "Hello Aonestudy. Study free online: ";
$aone_number = 24;
$aone_ch = hours;
echo $ aone_string;
echo $aone_number;
echo $aone_ch;
?>
Output
Hello Aonestudy. Study free online: 24 hours

Echo variables and text string

You can also place variables inside the double-quoted string (“String and $variable”). By putting the variable inside (“ ”) PHP grab the string value of that variable and use it in the string. Shows the example below.

PHP Code
<?php
$aone_string = "Hello aone.  Aonestudy is: ";
echo "$aone_string Free Tutorial <br />";
echo "Hi,I'm aonestudy Tutorial. Study Online Free $aone_string <br />";
echo "Hi, I'm aonestudy.  Study Online Free $aone_string Free";
?>
Output
Hello aone. Aonestudy is: Free Tutorial
Hi, I'm aonestudy Tutorial. Study Online Free Hello aone. Aonestudy is:
Hi, I'm aonestudy. Study Online Free Hello aone. Aonestudy is: Free 
Previous Home Next