I\'m using some $_SESSION variables for filtering many query records that have a similar name (ex. $_SESSION[\'nameFilter\'] or $_SESSION[\'cityF
$_SESSION
$_SESSION[\'nameFilter\']
$_SESSION[\'cityF
Use foreach to enumerate the keys of $_SESSION[], use substr() to get the last 6 characters of each key, use unset() to (what else?) unset it.
$_SESSION[]
As easy as:
session_start(); foreach (array_keys($_SESSION) as $key) { if (substr($key, -6) == 'Filter') { unset($_SESSION[$key]); } }