Re: Formatting plain text file
| From: | kranthi | Date: | Fri, 31 Jul 2009 01:31:22 +0000 |
| Subject: | Re: Formatting plain text file | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296089@lists.php.net to get a copy of this message | ||
<?php
//assuming you have a 2d matrix $table
$table = array(
array("c11", "c12", "c13"),
array("c21", "c22", "c23")
);
foreach($table as $rows) {
$row = vsprintf(str_repeat("%-10s", count($rows)), $rows);
echo "{$row}<br />\n";
}
wont this do ?