note 16586 deleted from function.explode by jimw
| From: | jimw@php.net | Date: | Mon, 05 Nov 2001 20:50:53 +0000 |
| Subject: | note 16586 deleted from function.explode by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-20474@lists.php.net to get a copy of this message | ||
<?php
function TROut($message) { /*And NO comments about fish, please! ;) */
PRINT "<TR>\n";
$cells=explode("|",$message);
$iterations=count($cells);
$i=0;
while ($i<$iterations) {
list($message,$span)=explode(":",$cells[$i]);
if (strlen($message)<1) $message=" ";
if ($span){
$this->TDOut ($message,$span);
}else{
$this->TDOut ($message);
}
$i++;
}
PRINT "</TR>\n";
}
?>
<TABLE>
<?
$Theader->TROut("Name:2|Address:3");
$Theader->TROut("First|Last|City|State/Province|Country");
$Tbody->TROut("Rod|Kreisler|Cortlandt|New York|USA");
?>
</TABLE>
Wow. That's a lot easier. But what if the data is in variables? Simply join the array:
<?php
$message=join($arry,"|");
$Tbody->TROut($message);
?>