32.5 Input Filter
PHP has an integrated extension that takes care of filtering input. The initial developers of the package are Derick Rethans and PHP inventor Rasmus Lerdorf.
This extension is available without any further installation steps. It does not operate at the SAPI level, so it does not intercept any input before PHP even sees it. Instead, the filter implements several functions that filter data in such a way that in the end (according to the plan), nothing harmful is included.
One of the main functions of the extension is filter_input(), with which you can determine GET, POST, and cookie data. You specify the type of data (INPUT_GET, INPUT_POST, INPUT_COOKIE), then the name, and finally the desired data type. If this is not ful ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access