How to use validations in php?(codelgniter)

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


Please Help Members By Posting Answers For Below Questions

How can we submit from without a submit button?

758


Does php need html?

725


What is difference between python and php?

723


Does php support function overloading?

746


What is == and === in php?

679


What is php written in?

748


Is facebook still written in php?

751


Explain what is the function file_get_contents() usefull for?

727


How can you retrieve data from the mysql database using php?

752


How to find length of an array in php ?

760


Tell me will a comparison of an integer 12 and a string "13" work in php?

865


How does session work in php?

743


Does php class need constructor?

706


What is the importance of "method" attribute in a html form?

783


How do I install php?

812