I have a class which made a lot of html functions.
One of this print an array in a table.
I need to know the number of columns in my table?
Here is just a short exemple of my script.
NOTE : I never know how many columns and how many rows I will send to this function.
function print_array($value) {
$j=count($value); #NR OF COLUMNS
$k=1;
reset($value);
echo "<TABLE BORDER=0 >";
do {
print "<TR>";
for ($i=0;$i<$j;$i++) {
echo "<TD>";
echo $value[$k][$i];
echo "</TD>";
}
print "</TR>\n";
} while (next($value));
print "</TABLE>\n";
}
Now I use this but it's not correct because if I send a 2 X 10 array it will print a table with 10 colums and 10 rows.
I searched in manual but no result for this problem
If it is a better way for doing this please note me.
King regards,
iugin