php - Fatal error: Can't use function return value in write context in.. when i'm trying to display my errors in register.. using array display -
i have php code here:
if(empty($_post) === false) { $required_fields = array('username','password','confirm_password','first_name','email'); foreach($_post $key=>$value) { if(empty($value) && in_array($key, $required_fields) === true) { $errors() = 'fields marked asterisk required'; break 1; } } } print_r($errors);
what i'm trying display arrays can figure out where's error.. browser said fatal error: can't use function return value in write context in
.. , marks fatal error in statement. $errors() = 'fields marked asterisk required';
help me please.. anyway registration-form.php :)
change bracket square ones:
$errors[] = 'fields marked asterisk required';
Comments
Post a Comment