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
Write a program to find the factorial of a number in php?
What's the output of the ucwords function in this example?
What is a composer in PHP?
What are psrs? Choose 1 and briefly describe it?
How can you declare the array in php?
How to know user has read the email-php?
What function should you use to join array elements with a glue string?
Can we use onclick in submit button?
Which variable declarations within a class is invalid 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 the difference between get & post ?
Write a program to find a string is palindrome or not?
What are the differences between php constants and variables?
Should I learn php before wordpress?
Is rent a variable cost?