Initial commit
This commit is contained in:
13
includes/flash.php
Normal file
13
includes/flash.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
function flash_set(string $type, string $msg): void {
|
||||
$_SESSION['_flash'] = ['type' => $type, 'msg' => $msg];
|
||||
}
|
||||
|
||||
function flash_get(): ?array {
|
||||
if (empty($_SESSION['_flash'])) return null;
|
||||
$f = $_SESSION['_flash'];
|
||||
unset($_SESSION['_flash']);
|
||||
return $f;
|
||||
}
|
||||
Reference in New Issue
Block a user