You are here: Re: limit output to only php print/echo statements? « PHP Programming Language « IT news, forums, messages
Re: limit output to only php print/echo statements?

Posted by C. on 04/14/07 21:27

On 14 Apr, 03:58, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> ken wrote:
> > is there a way to make a php page only output content that is generated
> > from php statements, such as print, or echo? ie: if I have whitespace
> > (or other text) outside my <?php .... ?> block i do not want that to be
> > returned.
>
> > of course i can do this by making sure my php file starts with <?php and
> > ends with ?> and there is no leading or trailing whitespace. but if
> > whitespace does creep into my file then it would be neat if there was
> > some kind of directive or something that would make sure it doesn't get
> > output.
>
> > i ask this because the output from my script will be interpreted by
> > another program so i want the output to be specific space delimited
> > values with no leading/trailing whitespace.
>
> > of course i should probably just output my content in xml format and
> > make my interpreting program parse xml, which accommodates for
> > whitespace... but... that would be smart, which i am not.
>
> > thanks!
> > ken
>
> No. PHP has no control over what's outside the <?php and ?> tags.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================


Not necessarily true. There's nothing to stop you writing a filter (in
PHP or other language) which processes a PHP script to return just the
PHP code, and then pass that through the interpreter - and with
mod_rewrite it could all be done transparently. But its not the way to
solve the OPs problem.

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация