note 60981 deleted from function.current by tularis
| From: | tularis@php.net | Date: | Sun, 22 Jan 2006 16:45:10 +0000 |
| Subject: | note 60981 deleted from function.current by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-102241@lists.php.net to get a copy of this message | ||
Note Submitter: Christian Sola Idígora
Reason: useless
----
function that create a table firstly verified if is an array, afterwards it use current() and next()
for list all elements
<?php
function create_table($elements,$border=1)
{
if(!is_array($elements)){
echo "\"$elements\" it's not an array";
exit;
}
echo"<table border=$border>";
reset($elements);
$value=current($elements);
while($value)
{
echo "<tr><td>$value</td></tr>\n";
$value =next($elements);
}
echo "</table>";
}
$arraye = array("qwerty","steve");
create_table($arraye);
?>