What does an echo function do?
What is the difference between using single quotes and double quotes in the echo function?
Showing posts with label echo function. Show all posts
Showing posts with label echo function. Show all posts
Sunday, September 7, 2008
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;
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’;
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
Smith
2.
Jones
3.
My name is Natasha
What is yours?
4.
My name is $name
5.
My name is John
Labels:
display,
dollar sign in php,
echo,
echo function,
output,
print,
programming,
programming with php
Subscribe to:
Posts (Atom)