Friday, September 5, 2008

The echo function

The echo function is used to print one or more variable in the output.
Syntax: echo variable-name;
Example inputs
1.
echo “smith”;
2.
$name = “Jones”;
echo $name;
3.
$name=”Natasha”;
echo “My name is $name”;
echo “

echo “What is yours?”;
4.
$name = “Robin”;
echo ‘My name is $name’
5.
echo ‘My’,’name’,’is’,’John’;
Example outputs:
1.
Smith
2.
Jones
3.
My name is Natasha
What is yours?
4.
My name is $name
5.
My name is John

No comments: