echo "Hello, world"; // print works just the same print "Hello, world"; // numbers can be printed too echo 123; // So can the contents of variables echo $outputString;
Output Data Shortcut - An alternate to print or echo
There is also a shortcut that can output data. The following very short script outputs the value of the variable
print vs echo
The difference between
echo is that
echo can output more than one argument:
echo "Hello, ", "world";
echo statements are also often seen with parentheses:
echo "hello"; // is the same as echo ("hello");
Parentheses make no difference to the behavior of
echo, only one output parameter can be provided.
printf later in this section.