Re: Handling of constants in strings
| From: | Uwe Birkenhain | Date: | Tue, 02 Jul 2002 10:24:36 +0000 |
| Subject: | Re: Handling of constants in strings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104888@lists.php.net to get a copy of this message | ||
Richard Lynch schrieb in Nachricht
<20020701232114.VOAI6023.sccrmhc02.attbi.com@[192.168.1.103]>...
>
>Try this:
>$my_string = "This is {MY_CONSTANT} and I love it!";
>
>Can't promise it will work, mind you...
>
>It's not all that common to bury constants in strings... And is the extra
"
>. " K ". " that big a deal? Seems a small price for cleaner code.
Thank's Richard,
you are right: it's not such a big deal - I was just surprised that I can't
integrate constants as variables.
A question - since english is not my first language - what do you mean with
>It's not all that common to bury constants in strings
Is something bad about it?
I would e. g. define our name with the formatting tags as a constant or
parts of query clauses which will never change but are often used.
Greetings,
Uwe