PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

What is the difference between print and echo?


You are unlikely to ever want to know this, however the difference is that print will return a value to let you know if the statement worked or not, whereas trying the same thing with echo will result in error:

<?php
echo "Please don't make me say it... \n";
$you = print "Hello World!\n";
echo 
"Returning $you"//Returning 1, assuming the print worked
?>



More strings PHP Questions

How can I remove trailing space from a string?
How do I find the length of a string in PHP?
How do I make the first letter of each word upper case?
How do I add commas easily to a string of numbers?
How do I convert characters to HTML entities using PHP?