PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

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
?>

Comments on this Question/Answer

How can i highlight the existence of particular word from a given string.eg. string is........"this is my first program, that is going to be excute". Now problem is to highlight the existence of "is" in to whole string.
By: Rimple, 05 Dec 2008 02:53:40



Reply to comments / post your own comment >>>

ASK A QUESTION

More strings PHP Questions

print(1 . " + " . 2 . " = " . 1+2 . "n"); gives answer 3 why?

Hello, Is it possible to specify a character-encoding in the filter_var function. Thank you for your reply, Jan

How do I make the first letter of each word upper case?

How do I remove trailing whitespace from a string?

How do I find the last occurrence of a character in a string?



Custom Search