What is the Diff. Between echo() and Print() in PHP?

Answer Posted / ashish zarkar

echo is statement and print is function
echo evaluate the string before send the output just like this
$a=10
echo "Value is $a"
output:- Value is 10

print 'Value is $a'
output:- Value is $a

print does not evaluate the stirng but echo does and one
thing more echo is faster then print because echo does't
return any value just given the output

Is This Answer Correct ?    13 Yes 47 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the methods of array in java?

509


What is the difference between associative array and indexed array?

525


What are traits?

718


Describe the security vulnerability of PHP?

624


Does empty check for null?

556






Write a program to find no of days between two dates in php?

529


Is php an oop?

532


What does $_cookie means?

580


What is slim framework?

517


Explain soundex() and metaphone().

586


Do you know what does mvc stand for and what does each component do?

518


How do I debug php?

540


What is session in c#?

548


What is meant by variable variables in php?

540


Can age be a variable?

537