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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!