I'm wanting to display a general error message if there are any errors in the validation_errors()
array, but if I do something like
if(isset(validation_errors())) { echo 'error'; }
then it returns back and says:
Fatal error: Can't use function return value in write context
Any help would be grand.
if(validation_errors() != false) { echo 'error'; }
isset
is used to Determine if a variable is set and is not NULL
Just echo vadidation_errors()
It will output if there are errors, and nothing if no errors. You don't need if
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.