php howto unset static var
<p>i have a function like this. i want reset the $output var first call.</p>

<pre><code>function create_tree($tree_array, $reset = TRUE, $ul_class = FALSE) {

    if($reset) unset($output); // NOT WORK!!!

    static $output = '';

    $class = '';
    if ($ul_class) {
        $class = ' class="' . $ul_class . '"';
    }
    $output .= '&lt;ul' . $class . '&gt;' . PHP_EOL;

    foreach ($tree_array as $v) {

        $output .= '&lt;li&gt;&lt;a href="'  . site_url_i18n($v['link']) . '"&gt;' . $v['name'] . '&lt;/a&gt;' . PHP_EOL;;

        if (isset($v['children'])) {
            create_tree($v['children'], false);
        }

        $output .= '&lt;/li&gt;' . PHP_EOL;
    }

    $output .= '&lt;/ul&gt;' . PHP_EOL;

    return $output;
}
</code></pre>
