Hi Alex, thanks for replying.
This code is spot on appart from one array instance. I've stripped the code down temporarily for ease:
function hidden_fields_recursive($arr){
foreach($arr as $key => $val) {
if (is_array($val)){
hidden_fields_recursive($val);
} else {
if (substr($key, 0, 6) == 'build_') {
echo 'name: '.$key.' | value: '.$val;
}
}
}
}
$arr = array(
"build_age" => 20,
"build_list" => array(
11 => 11,
7 => 7,
8 => 8,
),
"build_options" => array(
"build_date" => array(
"month" => 6,
"day" => 14,
"year" => 2010,
),
"build_hour" => 10,
"build_hour" => 17,
),
);
hidden_fields_recursive($arr);
Results in:
name: build_age | value: 20
name: 11 | value: 11
name: 7 | value: 7
name: 8 | value: 8
name: build_options | value: Array
name: build_date | value: Array//(can't always guarantee the name will be build_date)
name: month | value: 6
name: day | value: 14
name: year | value: 2010
...ect
but I'm hoping to return the build_list and build_date values as strings. ie:
name: build_list | value: 11,7,8
name: build_date | value: 6,14,2010
Hope that makes sense,
thanks again for any help