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
What is php stack?
How to get ip address of a server in php?
Is facebook still in php?
What is csrf verification?
What is move_uploaded_file in php?
What is the function to count elements in an array in PHP?
What does $globals mean?
Tell me what are magic methods?
What is difference between readonly and constant?
What is php and what does it do?
How do you end a function in python?
How to get best php developer Experience in Php with Sugar CRM / VTiger.
Tell me what does the initials of php stand for?
Is false empty php?
What is the use of stripslashes in php?