PHP: Reformatting Array -


help me reformat array this:

array (     [samplearr] => array         (             [0] => array                 (                     [id] => 1                 )              [1] => array                 (                     [id] => 2                 )          )  ) 

this array need reformat in above array:

array (     [samplearr] => array         (             [id] => 1             [id2] => 2         )  ) 

may can looping again array this.

$data['samplearr'] = []; foreach($data['samplearr'] $key => $value) {    $k = !empty($key) ? $key : "";    $format['samplearr'][$value['id'].$k] = $value['id']; }     

Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -