Hi, i need some help printing a mutlidimensiona l array, i can do it
for square Matriz MxM but i need to print an MXN matrix.
here is my code :
function printMatrix($ma trix){
echo "<table width=\"200\" border=\"1\">";
foreach($matrix as $row =$rValue){
echo "<tr>";
foreach($rValue as $col =$cValue){
echo "<td>".$cValue. "</td>";
}
echo "</tr>";
}
echo "</table>";
}
and this is the message i get:
Warning: Invalid argument supplied for foreach()
please help me
for square Matriz MxM but i need to print an MXN matrix.
here is my code :
function printMatrix($ma trix){
echo "<table width=\"200\" border=\"1\">";
foreach($matrix as $row =$rValue){
echo "<tr>";
foreach($rValue as $col =$cValue){
echo "<td>".$cValue. "</td>";
}
echo "</tr>";
}
echo "</table>";
}
and this is the message i get:
Warning: Invalid argument supplied for foreach()
please help me
Comment