<?Php
echo "Hello World";
?>
To learn more on this let us try to print the value of a PHP variable. To start with let us print today's date by using one variable.
<?Php
$date= date("m/d/y");
echo "Today is $date";
?>
Some time we may require to print the name of the variable than printing the data. So here we will use escape character ( \ ) before the $ symbol to tell PHP that consider the next character as string and not as a variable.
<?Php
$date= date("m/d/y");
echo "Today is $date, this value was stored inside variable \$date";
?>
<?Php echo $value; ?>
We can also use escape character ( \ ) to print double quotes to the screen by using echo command. Here is an example.
<?Php
echo "John said \"He is learning PHP \" by reading ";
?>
Output is here
John said "He is learning PHP " by reading
print to output string Introduction to PHPAdding delay to script execution
Guide to installation and How to write our first PHP Script
Dan Land | 27-02-2010 |
Your tutorial is helpful and most appreciated. I've learned a lot |