Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started