finding difficult to put into table.Also displays 1 ,34 etc
This is the code
<?php
$arrays = array(
array(1, 34, 32 , 2, 4),
array(3, 32, 13 , 11, 89),
array(56, 11, 7 , 9, 95),
array(14, 90, 333 , 23, 1),
array(5, 33, 54 , 23, 41)
);
for ($i = 0; $i < count($arrays); $i++){
for ($l = 0 ; $l < count($arrays[$i]); $l++){
print $arrays[$i][$l];
print "<br>";
}
}
Can someone assist pls
Move the br down one curly brace
at the first it's better to use $Array = [1,34,32,2,4] instead of $Array = array(1,34,32,2,4) Ok? the second one is old. <?php // Init $arrays = [ [1, 34, 32 , 2, 4], [3, 32, 13 , 11, 89], [56, 11, 7 , 9, 95], [14, 90, 333 , 23, 1], [5, 33, 54 , 23, 41], ]; for ($i = 0; $i < count($arrays); $i++){ for ($l = 0 ; $l < count($arrays[$i]); $l++){ print $arrays[$i][$l]; } print "<br />"; } as @LKD70 said . but the formula is the second "loop" always print items in one line and the first "loop" always shows count of lines. if you want understand completely please try "pyramid" like this : ***** **** *** ** * or * ** *** **** ***** Can someone assist pls
Обсуждают сегодня