By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,304 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,304 IT Pros & Developers. It's quick & easy.

echo vs print

P: n/a
What's the difference between Echo and Print?

J.
Jul 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
In message-id <40***********************@news.optusnet.com.au> ,
James Smith wrote:
What's the difference between Echo and Print?


http://www.faqts.com/knowledge_base/...l/aid/1/fid/40
Jul 17 '05 #2

P: n/a

"James Smith" <sm****@myrealbox.com> wrote in message
news:40***********************@news.optusnet.com.a u...
What's the difference between Echo and Print?

J.


Print is possible only when there's freedom of the press. Otherwise all you
can do is echo.
Jul 17 '05 #3

P: n/a
"James Smith" <sm****@myrealbox.com> wrote in message
news:40***********************@news.optusnet.com.a u...
What's the difference between Echo and Print?


One is spelt echo and the other is spelt print otherwise they are pretty
much the same, and your choice will depend on what programming languages you
used prior to php or what source you learnt php from.
Jul 17 '05 #4

P: n/a
James Smith wrote:
What's the difference between Echo and Print?


Although both are language constructs, print() can be used as a
function.
1 <?php
2
3 $x = 'hello world';
4
5 if (print($x)) echo 'if (print()) worked';
6 echo "\n";
7 if (echo ($x)) echo 'if (echo()) worked';
8 echo "\n";
9
10 ?>
Here, line 7 gives a parse error.

--
USENET would be a better place if everybody read: | to email me: use |
http://www.catb.org/~esr/faqs/smart-questions.html | my name in "To:" |
http://www.netmeister.org/news/learn2quote2.html | header, textonly |
http://www.expita.com/nomime.html | no attachments. |
Jul 17 '05 #5

P: n/a
James Smith <sm****@myrealbox.com> wrote in message news:<40***********************@news.optusnet.com. au>...
What's the difference between Echo and Print?


Manual is your friend. www.php.net/<keyword>
==> http://www.php.net/echo

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #6

P: n/a
James Smith wrote:
What's the difference between Echo and Print?


echo is faster and less to type. ;)

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Jul 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.