Here is the question:
Compare the first element of array1 to the last element of array2
and so on, each time storing the larger when compared in a thrid array
so for example in array1 the first element is 12 and in
array2 the last element is 3 so 12 should be stored in the third array.
Please help me, It is driving me crazy
Here is the code I have so far
Code: Select all
<?php
function arrays($array1,$array2)
{
if(count ($array1) != count ($array2))
{
echo "Number of item are not equal";
}
else
{
foreach($array1 as $itm1)
{
}
}
$my_array1= array(12,3,7,6,);
$my_array2= array(1,9,7,3);
arrays($my_array1,$my_array2);
?>