Skip to content

Instantly share code, notes, and snippets.

@ken-muturi
Created November 17, 2013 05:28
Show Gist options
  • Select an option

  • Save ken-muturi/7509677 to your computer and use it in GitHub Desktop.

Select an option

Save ken-muturi/7509677 to your computer and use it in GitHub Desktop.
Flash Session Implementation
public static function get_flash_data($key)
{
if (isset($_SESSION['flash'][$key])) {
$flash_data = $_SESSION['flash'][$key];
unset($_SESSION['flash'][$key]);
return $flash_data;
} else {
return null;
}
}
public static function set_flash_data($key, $data)
{
if (!isset($_SESSION['flash'])) $_SESSION['flash'] = array();
$_SESSION['flash'][$key]= $data;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment