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

What is baseurl?

530


What are the three classes of errors that can occur in php?

519


What is php.ini & .htacess file?

525


Are php sessions secure?

529


Is php used for frontend or backend?

528






How can you compare objects in php?

500


What is prepare in php?

517


Why php is widely used?

541


how to open & closing opening period in fico

1215


What is beforeRender() used?

629


Does php 7 support multiple inheritance?

513


How does php server work?

531


What is mysqli php?

519


What is encapsulation in php with example?

552


Tell me what does the php error 'parse error in php - unexpected t_variable at line x' means?

557