Posted by Mike on 10/15/07 12:11
"lskatz" <lskatz@gmail.com> wrote in message
news:1189885512.959260.307230@19g2000hsx.googlegroups.com...
> 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;
> }
:)
Mike
--------------------------------------------------
http://www.documentscanningbureau.com
[Back to original message]
|