Question: Write a PHP code to: 1- Create a 2-dimensional array, with a random number of rows and columns. 2- Fill the array with random numbers.
Write a PHP code to:
1- Create a 2-dimensional array, with a random number of rows and columns.
2- Fill the array with random numbers.
3- Send the array to a function that returns the number of the highest frequency in the array.
P.S: based on this code for the random array :
function search($s, $row, $col){
for($i=0;$i<$row;$i++){ for($j=0;$j<$col;$j++) echo $s[$i][$j] . " "; echo " "; } }
$a = array();
$r = rand(1,10); $c = rand(1,10);
for($i=0;$i<$r;$i++) for($j=0;$j<$c;$j++) $a[$i][$j]= rand(1,10);
search($a, $r, $c);
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
