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
I am writing an application in php that outputs a printable version of driving directions. It contains some long sentences, and I am a neat freak, and would like to make sure that no line exceeds 50 characters. How do I accomplish that with php?
What is $_ files in php?
How do you define a constant?
Explain Type hinting in PHP?
What is the use of magic function in php?
What is the current stable version of php? What advance thing in php7?
Explain preg_Match and preg_replace?
What can php do?
Explain me difference between mysql_connect and mysql_pconnect?
What is the goto statement useful for?
Why do we use sessions in php?
What types of loops exist in php?
Which is correct about mysqli and pdo?
What do you mean range() in php?
What type of operation is needed when passing values through a form or an url?