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
Read http://php.net/manual/en/function.isset.php
Just echo vadidation_errors()
It will output if there are errors, and nothing if no errors. You don't need if
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With