Sort an array when two halves are sorted | PHP program to Merge two sorted halves of array Into Single Sorted Array ; Sort the given array using sort STL ; Driver Code ; Print sorted Array
< ? php function mergeTwoHalf ( & $ A , $ n ) { sort ( $ A , 0 ) ; } $ A = array ( 2 , 3 , 8 , -1 , 7 , 10 ) ; $ n = sizeof ( $ A ) ; mergeTwoHalf ( $ A , $ n ) ; for ( $ i = 0 ; $ i < $ n ; $ i ++ ) echo $ A [ $ i ] . " ▁ " ; ? >