Re: printf() suggestion
| From: | Stanislav Malyshev | Date: | Wed, 19 Jul 2000 13:49:48 +0000 |
| Subject: | Re: printf() suggestion | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-25096@lists.php.net to get a copy of this message | ||
MO>> For an example, this:
MO>> printf("%h,%u",$string1,$string2);
MO>>
MO>> would be a shorthand way of doing this:
MO>> printf("%s,%s",htmlspecialchars($string1),urlencode($string2));
Well, I'd think this, though non-standard, is not a bad addition. Only
problem the "u" character already has meaning in C printf - it's "unsigned
decimal". The "U" is free, though.
MO>> *) easier to remember and shorter to type than htmlspecialchars()
MO>> *) maybe faster, especially if printf() is already being used
Well, I don't think it'd be really faster, but that doesn't matter too
much.
MO>> cons:
MO>> *) duplicates existing functionality
THis is not much of a problem too. There are number of aliases in PHP
already.
--
Stanislav Malyshev stas@zend.com
+972-3-6139665