What is the Diff. Between echo() and Print() in PHP?
Answer Posted / vinay sachan
There are many differences in print() and echo() :-
1-echo is unformatted whereas print is formatted.
2-echo() can take multiple expressions, Print cannot take multiple expressions.
ex.-
<?php
$name="Vinay";
echo "Name is $name";
//Value is Vinay
print 'Name is $name';
//Value is $name
?>
3-Print return true or false based on success or failure whereas echo just does what its told without letting you know whether or not it worked properly.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Can you define an array argument as a reference type?
Is it possible to destroy a cookie?
Name some of the constants in php and their purpose.
What are the methods of array in java?
Is salary fixed or variable cost?
What is singleton class in php?
What are the functions used in php?
Applications written to provide a GUI shell for Unix and Linux are called
What is associative array in php?
What is static in php?
What is $$ in php?
Suppose the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?
What is strlen function in php?
Is server side a session?
What is the difference between characters 34 and x34?