Since PHP version 2 I haven't seen the use of echo with parenthesis. Most
people opt for a simple echo "Booyaaa"; instead of echo("Booyaa"); since
"echo" is not really a function. Read more here:
http://www.php.net/echo

Happy php coding.

Milan


On 10/3/07, Joel Cochran <joelcochran@xxxxxxxxx> wrote:

On 10/3/07, Simon Cockayne <simon.cockayne@xxxxxxxxx> wrote:

Hi Larry, Jim, Joel,

*** In addition to echo you can also use: include, include_once, require
or
require_once, to bring in the contents of another file...which could
contain
straight HTML or code to produce HTML.

See http://devzone.zend.com/manual/function.require.html.


This is an excellent way to modularise your code...i.e. a change to the
included/required file is rippled throughout all files that
include/require
it, e.g:


By and far my favorite feature of PHP. All my websites are designed with
this modular approach. It allows me to have a single file for updating
the
banner, another for the footer, another for the navigation, etc. etc. I
can
change the entire site by updating a single file. Very handy. In fact,
for
you to take advantage of reusable OO PHP code, this is necessary (I
recommend require_once for OO includes).

BUT: let's not confuse things and say it is a replacement for echo(),
because it isn't. They serve two distinct functions: echo outputs to
standard out (in PHP's case, this is back to the browser). All the
include
functions do is bring the contents of another file into the current code,
kind of like a /copy in RPG. They bring them in at the exact placement of
the statement and they may or may not contain code that gets directly
outputted to the browser. As I mentioned above, they may simply include
class definitions or functions.

I just felt it was an important distinction.

--
Joel Cochran
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.