Re: true ? echo "y" : echo "n"
| From: | Chris Hayes | Date: | Mon, 26 May 2003 15:08:34 +0000 |
| Subject: | Re: true ? echo "y" : echo "n" | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-148988@lists.php.net to get a copy of this message | ||
At 16:19 26-5-03, you wrote:
Why doesn't this work? true ? echo "y" : echo "n" ; So it's like this: if(true) { echo "y"; }else{ echo "n"; }see other replies. i want to add that in echo constructions i always add (parentheses), like echo 'The answer is '
.(($x==0)?'no':'yes')
.'.' ;