How to merge arrays with sort in PHP -


does have idea how merge , sort array in php? have array "aaa". when print:

array (     [aaa] => array         (             [0] => array                 (                     [0] =>                     [1] => c                 )             [1] => array                 (                     [0] => b                 )         ) ) 

how can merge array result like:

array (     [aaa] => array         (             [0] =>             [1] => b             [2] => c         ) ) 

thanks.

try code, have tried code working expect.

example:-

    <?php     $array = array('aaa' => array(array('0' => "a",'1' => "b"), array('0' => "b")));      //before sorting    echo "before sorting****".'<pre>';     print_r($array);     echo '</pre>';      $my_array = array_merge($array['aaa'][0], $array['aaa'][1]);     //after sorting        echo "after sorting****".'<pre>';     print_r($my_array);     echo '</pre>';      ?> 

check out demo

output:-

before sorting****  array (     [aaa] => array         (             [0] => array                 (                     [0] =>                     [1] => b                 )              [1] => array                 (                     [0] => b                 )          )  )  after sorting****  array (     [0] =>     [1] => b     [2] => b ) 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -