php - Remove indexing from an array -
this question has answer here:
i have following array:
array(3) { [0]=> array(1) { ["theme_loader_plugin"]=> string(4) "_run" } [1]=> array(1) { ["user_plugin"]=> string(4) "_run" } [2]=> array(1) { ["sessions_plugin"]=> string(4) "_run" } }
is there way remove indexing using predefined php function , instead format this:
array(3) { ["theme_loader_plugin"]=> string(4) "_run", ["user_plugin"]=> string(4) "_run", ["sessions_plugin"]=> string(4) "_run" }
loop through array , merge them new array. hope -
$arr = array( array("theme_loader_plugin"=> "_run" ) , array("user_plugin"=> "_run" ) , array("sessions_plugin"=> "_run" ) ) ; $new= array(); foreach($arr $val) { $new = array_merge($new, $val); }
output
array(3) { ["theme_loader_plugin"]=> string(4) "_run" ["user_plugin"]=> string(4) "_run" ["sessions_plugin"]=> string(4) "_run" }
Comments
Post a Comment