Answer Posted / vileye
There are various ways to validate a data in php. It depends
on what you want to validate. The various validations are as
follows:
FILTER_VALIDATE_INT Validate value as integer, optionally
from the specified range
FILTER_VALIDATE_BOOLEAN Return TRUE for "1", "true", "on"
and "yes", FALSE for "0", "false", "off", "no", and "", NULL
otherwise
FILTER_VALIDATE_FLOAT Validate value as float
FILTER_VALIDATE_REGEXP Validate value against regexp, a
Perl-compatible regular expression
FILTER_VALIDATE_URL Validate value as URL, optionally with
required components
FILTER_VALIDATE_EMAIL Validate value as e-mail
FILTER_VALIDATE_IP Validate value as IP address, optionally
only IPv4 or IPv6 or not from private or reserved ranges
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the use of htmlentities in php?
What the use of var_dump()?
Do you know what are traits?
What is the use of "enctype" attribute in a html form?
How many types of array supported in php?
What is php session and how it works?
How can I load data from a text file into a table?
Which cryptographic functions in php returns the longest hash value?
How to retrieve the original query string?
What is php and why it is used?
How to check an key is exists in array?
Which is the latest version of php?
How do you trim spaces in excel?
What is the use of mysql_fetch_array in php?
What is singleton pattern in php?