You are here: Re: filehandle write to variable « PHP Programming Language « IT news, forums, messages
Re: filehandle write to variable

Posted by Rik on 06/22/07 09:42

On Fri, 22 Jun 2007 03:46:31 +0200, onlineviewer <lancerset@gmail.com> =

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 =3D '' ";
> open $writeto, '>>', \$string;
>
> foreach my $file(@array){
> print $writeto $file;
> }
>
Why not simply concate?

$string =3D '';
foreach($array as $item){
$string .=3D $item;
}

If you want to write to a variable using filehandles it becomes quite =

different, you'd have to register a stream wrapper to it, check out =

http://www.php.net/stream_wrapper_register

-- =

Rik Wasmus

 

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

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