answersLogoWhite

0


Best Answer

The print construct always returns the integer 1, whereas the echo construct has no return value (and as a result, print is slightly slower to execute than echo). Additionally, should you use the parenthesis syntax for both constructs, echo will accept an infinite amount of string arguments whereas print only accepts one.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between echo and print statement?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between echo cat and cat echo commands in Linux?

echo cat will print out the word 'cat' on the command line. cat echo will attempt to list the contents of a file called 'echo'.


What is the difference between echo and print in PHP?

Print always returns a value of true, but echo doesn't. echo also has a short cut syntax meaning you can immediately follow the php tags by an equals sign and it will echo the result like in the example shown below: <?=$hello?>


What is the difference between echo and print and printf in PHP?

The print function is slightly more dynamic than the echo function by returning a value, and the echo function is slightly (very slightly) faster. The printf function inserts dynamic variables/whatever into wherever you want with special delimiters, such as %s, or %d. For example, printf('There is a difference between %s and %s', 'good', 'evil') would return 'There is a difference between good and evil'.


What is the difference between echo and printf command of UNIX?

Echo merely repeats its command line arguments as stated. The 'printf' command allows for formatted print and a more exacting method of printing out information. Printf requires you to specify the format of what you want to print; echo does not have this ability.


What PHP statement outputs text on the screen?

There are several different ways to output text on the screen in PHP two of the most common are echo and print. echo "Hello World!"; print ("Hello World!"); Would both print ... Hello World!


What is the difference in accuracy between single and double beam echo sounder?

> You can use PHP variable name inside the double quote ("") Eg:- $name = 'Udit'; echo "Hello $name"; It will print: Hello Udit


How to display a variable in PHP using echo or print statements?

displaying a variable in php using echo statement? <?php $name="ram"; //declaring and defining the variable echo "$name"; //printing the variable using echo command ?>


What is difference between echo and ' ' in unix?

Echo is a program. '' is not a program. '' does not perform any action. Echo returns what you type. '' does not.


What is the difference between sonar and echo location?

Sonar location is in the water and echo location is in the air.


What is a regular expression in PHP?

echo or print < both of which write text: <?php echo "TEXT"; print "TEXT"; ?>


Write a unix program to print print a pattern?

echo 'print a pattern'


What is the difference between reverberation and echo?

The gaps between the reflections are long when you hear an echo. When the reflections are very close together then you here no single echo, you hear many close reflections as a reverberation.