note 84585 rejected from function.sprintf by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 17:24:06 +0000 |
| Subject: | note 84585 rejected from function.sprintf by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142208@lists.php.net to get a copy of this message | ||
Note Submitter: luhres
----
I like the placeholders $ option. But what doesn't seem to work is if you use it in a define();
For example this works:
define( HOME_TEXT, "Hello %s and welcome to %s" );
but not this
define( HOME_TEXT, "Hello $1%s and welcome to $2%s" );
This would be great to separate text from code and decouple as much as possbile.
You could replace the above by
define( HOME_TEXT, "You are in $2%s: welcome $1%s" );
without touching the code.
Any ideas?