Be aware that the value of this check entirely depends on the output context.
The validated text is not expected to be secure in every circumstance, if you
want to be sure of that, use a customized regular expression or filter on output.
See http://php.net/filter_var for details.