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