adspace
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
How to calculate the difference between two dates using php?
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
What does $_files means?
Tell me what kind of things have you done on the social side?
How to create a web form?
Write a program using while loop?
What is difference between static and final in php?
how to detect a mobile device using php
What is trait in php?
sort term descripttion form, report and uery
What sized websites have you worked on in the past?
How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain
Name and explain five of the PHP error constants?
List some features of php that are deprecated in php7?
What is the current stable version of php?