Write a PHP script to merge two arrays and sort them as numbers in descending order.
<?php
$ary1 = array(5,2,3,1,4);
$ary2 = array(10,8,6,7,9);
$result = array_merge($ary1,$ary2);
rsort($result);
echo "Array element in descending order:<br>";
foreach ($result as $ele) {
echo $ele."<br>";
}
?>
Sample Output$ary1 = array(5,2,3,1,4);
$ary2 = array(10,8,6,7,9);
$result = array_merge($ary1,$ary2);
rsort($result);
echo "Array element in descending order:<br>";
foreach ($result as $ele) {
echo $ele."<br>";
}
?>
Array element in descending order:
10
9
8
7
6
5
4
3
2
1
10
9
8
7
6
5
4
3
2
1