NYCPHP Meetup

NYPHP.org

[nycphp-talk] RE: Breaking out of PHP mode? (Can code be executed in heredoc?)

webapprentice at mail.com webapprentice at mail.com
Tue Feb 17 13:42:33 EST 2004


Hi Hans,
Thanks for the tip.  I am aware of this, so I do have another part of this PHP page that will call this function.
I just wanted to make sure that as the PHP is loading, that this code between the PHP blocks doesn't automatically sent to the output stream until I call it.

--Stephen


> Message: 6
> Date: Tue, 17 Feb 2004 07:56:57 -0800
> From: "Hans Zaunere" <hans not junk at nyphp.com>
> Subject: RE: Breaking out of PHP mode RE: [nycphp-talk] Can code be
> 	executed	ina heredoc?
> To: "NYPHP Talk" <talk at lists.nyphp.org>
> Message-ID:
> 	<41EE526EC2D3C74286415780D3BA9F8793745C at ehost011-1.exch011.intermedia.net>
> 	
> Content-Type: text/plain;	charset="us-ascii"
> 
> 
> > Just to clarify, if I do this...
> > 
> > <?php 
> > function printForm()
> > {
> > 
> >   // CODE
> > ?>
> > 
> > // HTML HERE
> > 
> > <?php 
> > 
> > } // end function
> > 
> > ?>
> > 
> > Then, the stuff between the PHP blocks is considered part of 
> > the function and will only execute when the function is 
> > called.  Is that correct?
> 
> Correct.
> 
> Remember, though, that the function is not returning anything... it's
> going directly out to the browser or output buffer.  This has a subtle,
> but possibly pertinent effect, ie:
> 
> <?php printForm(); ?>
> 
> and
> 
> <?=printForm()?>

-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm




More information about the talk mailing list