473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

echo vs print

What's the difference between Echo and Print?

J.
Jul 17 '05 #1
6 3373
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

"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
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lawrence | last post by:
Right now, over at www.monkeyclaus.org, the following script is getting to the 9th run through and dying after the line: echo "..."; You'll admit that is a strange place to die. I've hit...
6
by: Marco | last post by:
I have a couple pages that have tables, whats best use echo to produce the full table with the variables or is it best to just make the table in plain html and use <?php echo ('$va'l); ?> when i...
9
by: lawrence | last post by:
In the following loop, at the end, the method debugNotes() is printing out some notes for me to read, so I can figure out what is going on in my script. Where I try to print out the value of the...
13
by: Tony | last post by:
I'm just wondering why it seems most people use "echo" instead of "print". I tend to use "print", probably because I started programming in BASIC back in 78, so it's just familiar. Echo can take...
25
by: Jon Slaughter | last post by:
I have some code that loads up some php/html files and does a few things to them and ultimately returns an html file with some php code in it. I then pass that file onto the user by using echo. Of...
8
by: Tyno Gendo | last post by:
I have just written a line of code like this (yes, many people think this stinks bad): <?php true == isset($page_seq) ? echo "$page_seq" : false; ?> However it breaks with 'Unexpected T_ECHO'...
2
by: imran0092 | last post by:
Hi everyone Problem I am re-writing a website which was created in coldfusion. All the data is stored in MS SQL tables. The contents are long, some of them are over 8000 chars in a field. ...
3
tharden3
by: tharden3 | last post by:
Is there a quick way to ask to 'echo' or 'print' all elements of a numeric array? Can I specify to print "all of the keys" or "all of the values"? I wrote up 5 quick lines of code to print all of my...
3
by: xtremebass | last post by:
Hi Bytes.. I have command like this.. echo "km=cat /proc/meminfo | grep MemFree | awk '{ print $2 }' " i want to redirect this output to a file or output prompt i got printed km=cat...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.