Jump to content

[SOLVED] problem with flushing sessions script


boo_lolly

Recommended Posts

so, i need to remove all data from my sessions but for some reason it's not working out. i've tried session_destroy() but for some reason that didn't work so i wrote a script. but the script doesn't work.

 

error

Fatal error: Cannot redeclare flush() in /var/www/piratebeachhouse/index.php on line 294

 

script

<?php
    function flush($array)
    {
        foreach ($array as $key => $val) {
            if (is_array($val)) {
                flush($val);
            }
            else {
                $val = null;
            }
        }
    } //<-- line 294
?>

 

so what's the deal? i've written plenty of functions before that were repetitive. (i forgot the worf used when you call upon a function within the same function) what's wrong with my script? and what alternatives should i try?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.