1. 151.
    0
    <?php

    //this can be removed if you want to find out if you page has actually started a session, - this is sometimes a problem when relying on a session being started by an included/required file
    if(!isset($_session))
    {
    session_start();
    }

    //now begin the table
    echo '<table border=1><tr> <th>variable</th> <th>value</th> </tr>';
    foreach(get_defined_vars() as $key => $value)
    {
    //if the returned value is not an object...
    if (is_array ($value) && !is_object($key) && !is_object($value))
    {
    echo '<tr><td>$'.$key .'</td><td>';
    if ( sizeof($value)>0 )
    {
    echo '"<table border=1><tr> <th>key</th> <th>value</th> </tr>';
    foreach ($value as $skey => $svalue )
    {
    //and if these values are not an object...

    if ( !is_object($skey) && !is_object($svalue))
    {
    echo '<tr><td>[' . $skey .']</td><td>"'. $svalue .'"</td></tr>';
    }
    }
    echo '</table>"';
    }
    else
    {
    echo 'empty';
    }
    echo '</td></tr>';
    }else

    {
    echo '<tr><td>[' . $key .']</td><td>"'. $value .'"</td></tr>';
    }



    }

    echo '</table>';
    ?>
    ···