Hi!
I have an array with some repeated keys and i need to print that as it is without override values like php does.
// Example
$my_array = array('year' => '1974', 'car' => 'monza', 'car' => 'fusca', 'owner' => 'Giba');
foreach($my_array as $key => $val){
echo $key'. => .'$val.'<br>';
}
// actually prints:
//year => 1974
//car => fusca
//owner => Giba
// i would like:
//year => 1974
//car => monza
//car => fusca
//owner => Giba
I had dreaming about some function with an specified parameter to do it easily, e.g. :rolleyes:
function loop_array($arr, $override = FALSE){
// if TRUE no override values else overrride ...
}
Maybe do you know a trick or bypath to do it.
Kindest Regards,
marcoBR
BTW:.
Please, don't ask me why i need it ... just tell me if is possible to accomplish it! And sorry 4 my poor english. :p