|
Posted by lskatz on 09/15/07 19:45
Ah, nevermind, I realized I was adding onto my output variable twice.
Here's the fixed up function
function formatDocumentation($ToC,$level=0){
if($level==0) $output="";
$numMenus=count($ToC);
$name=array_keys($ToC);
$indentation=stringMultiply(" ",$level);
foreach($ToC as $thisName => $content) {
$output.= "$indentation$thisName\n";
if(is_array($content)){
$output.= formatDocumentation($content,$level+1);
}
else{
$output.= "$indentation$content\n\n";
}
}
return $output;
}
Navigation:
[Reply to this message]
|