print vs echo
- echo
echo can get several parameters, print can only get one.
<?php
echo 2, 3;
?>
<br>
<?php
// print 2, 3;
// Parse error: parse error
print 2;
print 3;
?>
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
echo can get several parameters, print can only get one.
<?php
echo 2, 3;
?>
<br>
<?php
// print 2, 3;
// Parse error: parse error
print 2;
print 3;
?>