Usenet Various Topics

Usenet Various Topics (http://www.varioustopics.com/)
-   PHP (http://www.varioustopics.com/php/)
-   -   echo vs print (http://www.varioustopics.com/php/570354-echo-vs-print.html)

James Smith 06-19-2004 03:45 AM

echo vs print
 
What's the difference between Echo and Print?

J.

Herbie Cumberland 06-19-2004 03:54 AM

Re: echo vs print
 
In message-id <40d39a93$0$16104$afc38c87@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



Chung Leong 06-19-2004 04:25 PM

Re: echo vs print
 

"James Smith" <smitro@myrealbox.com> wrote in message
news:40d39a93$0$16104$afc38c87@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.



CJ Llewellyn 06-20-2004 01:41 AM

Re: echo vs print
 
"James Smith" <smitro@myrealbox.com> wrote in message
news:40d39a93$0$16104$afc38c87@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.



Pedro Graca 06-21-2004 12:46 AM

Re: echo vs print
 
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. |


All times are GMT +2. The time now is 02:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0