Logging recursively
<p>I am trying to use my logger to dump variables to my logfile.
I need it to write down arrays within arrays.
Could you explain please how to do this ? (I am not sure of how to pass the sub-array of the rest of the array but here's what I came up with, which obviously is missing something)</p>

<p>Thanks</p>

<pre><code>function logRec($param)
{
    if(!isset($param))
        return;

    foreach($param as $key=&gt;$value)
    {
        if(is_array($value))
        {
            echo "&lt;b&gt;nested array&lt;/b&gt;&lt;br /&gt;";
            logRec(next($param));
        }
        else
        {   
            echo $param;
            return;
        }   
    }    
}   

$par = array("ABC","DEF",array("Apple","Peach","Melon",array("Cube","Sphere","Pyramid")));
logRec($par);
</code></pre>
