1

I'm working on a CodeIgniter project but having a problem when using ternary operator, I have this code:

<?php echo (validation_errors()) ? validation_errors() : ((isset($success)) ? $success : ((isset($failed)) ? $failed)); ?>

and I'm getting this error:

Parse error: syntax error, unexpected ')' 

Once I comment that line out, the page loads fine.

What could be the issue?

Thank you.

Mohamed Ebrahim
  • 232
  • 1
  • 3
  • 13

0 Answers0