new function: arr2tab - array to table
| From: | webograph | Date: | Sun, 18 Aug 2002 18:03:55 +0000 |
| Subject: | new function: arr2tab - array to table | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-8489@lists.php.net to get a copy of this message | ||
dear pear developement group,
to make it short: i've written a php function i've missed in php for a long
time; when i found the pear project, i thought about publishing it. i've
asked for pear dev membership, and after short correspondation with Martin
Jansen, he told me to introduce the script to this group.
the script is really small and doesn't do really hard work, but i think it
is very useful especially in the developement of php projects: it does
nothing more than converting a php array to an html table. it writes the
first dimension to a column, the second into rows and if there are more, the
table is nested (the function calls itself). using parameters, you can turn
labeling on or off and set the maximum depth (it looks really bad if there
are about six or even more dimensions).
the syntax is (do i have to add the class group, that is, HTML, before the
function name?): arr2tab($array, $maxdepth = 4, $label = true); - i think
that's self explaining.
unfortunately, the ftp part of my webserver is currently out of order; if
you like, send me a mail or answer this post, then i'll put the source code
either here or i'll mail it to you (as said, it's really small - except you
call 2 kbytes big).
webograph
webograph@hotmail.com