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 mysqli_query?
What is binary safe function in php?
What is php used for?
Tell me how is it possible to return a value from a function?
Why should I learn php?
How we get browser details of clients machine?
What is framework in php?
Differentiate between require and include?
can you give me an example code of calling java script function in php variable using AJAX.or with out ajax??????
What is fetch array in php?
How many types of errors in php?
How do I get csrf token?
Which programming language does php resemble?
What are the benefits of using php and mysql?
What software is required to run php?