PHP v.4.0.6 and recursion is it PHP or my code?
Posted: Wed Dec 29, 2004 5:00 pm
Before I go banging my head against the wall and drinking too much coffee I thought I would ask to see if I am just not seeing my smistake or does this version of PHP have a bug or limitaion.
Thanks for any input.
return text($v); is line 47
Thanks for any input.
Code: Select all
<?php
function text ($value){
if (is_array($value)){
foreach($value as $k=>$v){
if (is_array($v)){
return text($v);
}else{
$output .= $label[$i].'<br>'."\n";
$output .= '<input id="" name="'.$label[$i].'" type="text" value="'.$v.'">'."\n";
}
}
return $output;
}else{
$output .= $label[$i].'<br>'."\n";
$output .= '<input id="" name="'.$label[$i].'" type="text" value="'.$value.'"><br>'."\n";
return $output;
}
}
print text($value[$i]);?>Code: Select all
Fatal error: Cannot redeclare text() in /home/.sites/125/site219/web/site/kwiki_includes/common.php on line 47