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

Answer Posted / satyajit das

1> print()is am method which returns boolean parameter(s)
either 1 or 0. Where echo() is an object rather statement
which does not have any return parameter in spite of has
its functionality.

2> According to print is structured and faster in sence it
does not return any complex parameter but if the complex
parameter is concerned echo becomes slow. complex parameter
indicates any complex value like 1.3e^2.

3> print supports multiple arguements w.r.t. '.' like echo
e.g.

<?php

$p = "MY ISAM";

$j = 1;

print($p."&nbsp;".$j);

echo("<br>".$p.$j);

?>

Is This Answer Correct ?    20 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the current php version?

571


What is php and its advantages?

534


How long should a session last?

529


What do the initials of php stand for?

587


Which MySQL function would you use to select a database?

578






Is salary fixed or variable cost?

548


What is an array in php?

636


what is CURL?

595


How to calculate the difference between two dates using php?

559


What are session variables in php?

537


What is the importance of "action" attribute in a html form?

554


How to check curl is enabled or not in PHP

651


What is the use of htmlspecialchars in php?

540


Is it more secure to use cookies to trfer session ids?

533


Which is better get or post method?

479