I have been trying to use this code to print 10 columns and 10 rows. I get one or the other, can some one help me figure out how to get both. With the
I get 10 rows, with out it I get 10 columns. Will an IF statement help me? thanks
[php]
$array = array(‘1’ => “O”, ‘2’=>‘O’, ‘3’=> ‘$’, ‘4’=>‘M’, ‘5’ => ‘^’);
function populateRoom ($myArray) {
print "$myArray
";
}
for($row = 1; $row <= 10; $row++) {
for($c = 1; $c <= 10; $c++) {
$randomNumber = rand(1,5);
$myArray = $array[$randomNumber];
print $myArray;
populateRoom ($myArray);
}}
[/php]