<?php
$oldArray = array(
array("country", "state", "city", "name"),
array("Argentina", "Corrientes", "Corrientes", "Jorge"),
array("Argentina", "Chaco", "Resistencia", "Mariano")
);
$arr = array_shift($oldArray);
$new_arr = array_map(function($v)use($arr){ return array_combine($arr,$v);}$oldArray);
print_r($new_arr);
- Output for 7.0.0
- Parse error: syntax error, unexpected '$oldArray' (T_VARIABLE), expecting ',' or ')' in /in/D5KH4 on line 9
Process exited with code 255. - Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
- Parse error: syntax error, unexpected '$oldArray' (T_VARIABLE) in /in/D5KH4 on line 9
Process exited with code 255.
preferences:
170.37 ms | 1387 KiB | 24 Q