Problem with Tabs and Newlines
| From: | Phusion | Date: | Mon, 07 Mar 2005 14:55:49 +0000 |
| Subject: | Problem with Tabs and Newlines | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-210161@lists.php.net to get a copy of this message | ||
I'm having problems with a function I created to display filesystems.
The problem is that I can't get tabs (\t) or newlines (\n) to work.
function filesystems () {
$df =
df -kP;
$mounts = preg_split('/\n/', $df);
$row = "Filesystem\t" . "Size\n";
for ($i = 1, $max = sizeof($mounts); $i < $max; $i++) {
$row .= $mounts[$i];
$row .= "\n";
}
$result = $row;
echo $result;
}
...
<table border="1" cellspacing="0" cellpadding="0"
width="600" align="center">
<tr>
<td width="600"><? filesystems(); ?></td>
</tr>
</table>
I just put filesystem and size on the first line to test the \t for
creating a tab. The \t and \n don't seem to work. What am I doing
wrong here? Thanks for any help you can give me.