I was wondering how can I convert the code below into a PHP function that works.
Here is my original code.
if(isset($_GET['cat'])) {
$cat_name = strip_tags(filter_var($_GET['cat'], FILTER_SANITIZE_URL));
}
So far I got this for the function.
function cat(){
if(isset($_GET['cat'])) {
$cat_name = strip_tags(filter_var($_GET['cat'], FILTER_SANITIZE_URL));
}
}