Just use filter_input_array()
from the filter extension.
/* prevent XSS. */
$_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
This will sanitize your $_GET
and $_POST
.
More Related Contents:
- how can i passed array into a function in php [closed]
- Needle in a Haystack for Php [closed]
- Multiple inputs with same name through POST in php
- Creating one array from another array in php [closed]
- Filter array by its keys using an array of allowed keys
- How to echo or print an array in PHP?
- Reference – What does this error mean in PHP?
- Count number of values in array with a given value
- Which is faster in PHP, $array[] = $value or array_push($array, $value)?
- Difference between method calls $model->relation(); and $model->relation;
- array_unique for objects?
- A formula to find prime numbers in a loop
- String with array structure to Array [duplicate]
- php array behaving strangely with key value 07 & 08
- Difference between array_map, array_walk and array_filter
- Checking if array is multidimensional or not?
- PHP how to retrieve array values
- How can I use in_array if the needle is an array?
- PHP try-catch blocks: are they able to catch invalid arg types?
- How to get the last element of an array without deleting it?
- How to check if a specific value exists at a specific key in any subarray of a multidimensional array?
- Checking if ANY of an array’s elements are in another array
- Get array’s key recursively and create underscore separated string
- Split array into two arrays by index even or odd
- PHP rename array keys in multidimensional array
- How to check if variable is array?… or something array-like
- How to insert json array into mysql database
- Why do I get “Resource id #4” when I apply print_r() to an array in PHP? [duplicate]
- How to set an option from multiple options or array with different values to views as selected in select box using PHP
- Remove zero values from a PHP array