Re: using ($test)?$true:$false in a string
| From: | Marcus Bointon | Date: | Mon, 21 Nov 2005 17:49:23 +0000 |
| Subject: | Re: using ($test)?$true:$false in a string | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-226223@lists.php.net to get a copy of this message | ||
On 21 Nov 2005, at 15:43, Jochem Maas wrote:
using sprintf() is such a simple case may be excessive BUT I was merely introducing the OP to something new (possibly) - anyone asking such 'simple' questions is not at a stage that this kind of efficiency is an issue (i.e. give them 'whats possible' before telling them 'whats best')sprintf is also a good example of a different way of thinking about string interpolation, and what's more it's remarkably close to the whole concept of using prepared statements in SQL, a measure that can gain you both speed and security, plus it's supported very nicely in PDO in PHP 5.1. A tangent I know, but a useful one nonetheless. Hey, and I remember when "print using" was considered a 'power user' feature in BASIC in 1981! Marcus -- Marcus Bointon Synchromedia Limited: Putting you in the picture marcus@synchromedia.co.uk | http://www.synchromedia.co.uk