understanding a function .
Posted: Mon Dec 08, 2014 2:09 am
i have this belwo function
what are the below two lines of code really doing ??
Thanks.
Gautam.
Code: Select all
public function __construct($required = array(), $inputType = 'post')
{
if (!function_exists('filter_list')) {
throw new Exception('The Pos_Validator class requires the Filter
Functions in >= PHP 5.2 or PECL.');
}
if (!is_null($required) && !is_array($required)) {
throw new Exception('The names of required fields must be an array,
even if only one field is required.');
}
$this->_required = $required;
$this->setInputType($inputType);
}Code: Select all
if (!function_exists('filter_list')) {
throw new Exception('The Pos_Validator class requires the Filter
Functions in >= PHP 5.2 or PECL.');
}
if (!is_null($required) && !is_array($required)) {
throw new Exception('The names of required fields must be an array,
even if only one field is required.');
}
Gautam.