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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.