Re: Formatting
| From: | joris ros | Date: | Wed, 26 Jan 2011 05:43:08 +0000 |
| Subject: | Re: Formatting | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-311034@lists.php.net to get a copy of this message | ||
Hi You can try something like this:
<?php
ob_start();
system('ls', $retval);
$raw = ob_get_contents();
ob_end_clean();
$arr = explode(chr(10),$raw);
print_r($arr);
it gives you a array back whit the lines
2011/1/26 Donovan Brooke <lists@euca.us>
> Ethan Rosenberg wrote:
>
>> Dear list -
>>
>> I have a program with the following statement: $out = system('ls -l',
>> $retval); The output is a string. How do I format the output to be in
>> the Linux format, that is in columns. I cannot think of a way to use
>> explode to do it.
>>
>> Advice and comments, please.
>>
>> Thanks
>>
>> Ethan
>>
>> MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)]
>>
>
>
> Something like?:
>
> print "<pre>";
>
> $out = system('ls -l', $retval);
> print "</pre>";
>
>
> Donovan
>
>
> --
> D Brooke
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>