What is the difference between echo and print in php

What is the difference between echo and print in php

Both Echo and print are constructs.
echo is more efficient because it does not return any value.
Print returns a value most like a function but its construct .

One major difference is that echo can take multiple input parameters while print takes only one parameter.

echo ‘test5’, ‘test6’; // Concatenates the 2 strings
print(‘test5’, ‘test6’); // Fatal error


Advertisements

Add Comment

📖 Read More