You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On success returns the filtered variable.
If the variable is not set false is returned.
On failure false is returned, unless the FILTER_NULL_ON_FAILURE flag is used, in which case null is returned.
It does not seem to return null when the variable is not set:
No flags were set and notice that first case prints NULL. I believe this function always returned NULL if query string/post/cookie/etc variable is not present and the current documentation is incorrect about return values.
The text was updated successfully, but these errors were encountered:
Value of the requested variable on success, false if the filter fails, or null if the var_name variable is not set. If the flag FILTER_NULL_ON_FAILURE is used, it returns false if the variable is not set and null if the filter fails.
From manual page: https://php.net/function.filter-input
The Return Value section reads:
It does not seem to return
null
when the variable is not set:The above code produces the following results for the query strings:
No flags were set and notice that first case prints
NULL
. I believe this function always returnedNULL
if query string/post/cookie/etc variable is not present and the current documentation is incorrect about return values.The text was updated successfully, but these errors were encountered: