note 77269 deleted from function.echo by tularis
| From: | tularis@php.net | Date: | Thu, 01 Nov 2007 09:14:27 +0000 |
| Subject: | note 77269 deleted from function.echo by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-131906@lists.php.net to get a copy of this message | ||
Note Submitter: robertark at gmail dot com
----
You mentioned:
<?php
// Because echo does not behave like a function, the following code is invalid.
($some_var) ? echo 'true' : echo 'false';
?>
However, if you still want to echo a string, or anything else, you can use:
<?php
// This ternary operation will work because you can echo a bool true/false and vice-vursa
echo ($some_var) ? 'true' : 'false';
?>
Hope this helps for someone who doesn't understand this very well :)