3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = Array ( "0" => Array ( "id_user" => "1", "name_user" => "Thomas" ), "1" => Array ( "id_user" => "3", "name_user" => "David" ) ); foreach($array as $array_val) { $key = $array_val['id_user']; $val = $array_val['name_user']; $new_array[$key] = $val; } print_r($new_array);
Output for 5.6.0 - 7.2.6
Array ( [1] => Thomas [3] => David )