Reputation: 4212
I'm doing a get request with variable:
$url = $_GET['url'];
Now I would like to add some filtering option:
$url = (filter_var($_GET['url'], FILTER_SANITIZE_URL));
How do I include another filter option: FILTER_SANITIZE_STRING
Putting them next to each other doesn't work. I tried with array that also didn't work.
Upvotes: 0
Views: 59
Reputation: 16495
Why even sacrifice clarity for non-beneficial approach? Just keep it clear, simple.
$url = filter_var($_GET['url'], FILTER_SANITIZE_URL);
$final = filter_var($url, FILTER_SANITIZE_STRING);
Upvotes: 1
Reputation:
how about:
$url = filter_var(filter_var($_GET['url'], FILTER_SANITIZE_URL),FILTER_SANITIZE_STRING);
Upvotes: 1