-
-
Save nappa32/0f7feeafb254715a5f7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_param($key, $filter=FILTER_SANITIZE_STRING) { | |
if (!isset($_GET[$key])) { | |
return null; | |
} | |
return filter_var($_GET[$key], $filter); | |
} | |
function post_param($key, $filter=FILTER_SANITIZE_STRING) { | |
if (!isset($_POST[$key])) { | |
return null; | |
} | |
return filter_var($_POST[$key], $filter); | |
} | |
function cookie_param($key, $filter=FILTER_SANITIZE_STRING) { | |
if (!isset($_COOKIE[$key])) { | |
return null | |
} | |
return filter_var($_COOKIE[$key], $filter); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment