PHP ternary operator

Posted by thecoshman on Stack Overflow See other posts from Stack Overflow or by thecoshman
Published on 2010-04-23T12:19:26Z Indexed on 2010/04/23 12:23 UTC
Read the original article Hit count: 487

Filed under:
|
($DAO->get_num_rows() == 1) ? echo("is") : echo("are");

This dose not seem to be working for me,I get an error "Unexpected T_ECHO"

I have tried it with out the brackets around the conditional. Am I just not able to use a ternary operator in this way?

The $DAO->get_num_rows() returns an integer value.

Thanks

© Stack Overflow or respective owner

Related posts about php

Related posts about ternary-operator