Reply to Re: filehandle write to variable

Your name:

Reply:


Posted by gosha bine on 06/22/07 09:53

On 22.06.2007 03:46 onlineviewer wrote:
> Hello All,
>
> Can someone help me out with how to go about printing to a variable
> rather than to a file using filehandles. Below i have it in perl, how
> do i
> get this going in php. Thanks in advance...
>
> $string = '' ";
> open $writeto, '>>', \$string;
>
> foreach my $file(@array){
> print $writeto $file;
> }
>

Check out output buffering functions:

ob_start();

print "whatever";
print "something else";

$output = ob_get_clean();

Exactly the same functionality as in perl can be achieved using stream
wrappers. See example here:

http://www.php.net/manual/en/function.stream-wrapper-register.php


--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok

[Back to original 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

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