>Hi,
>when reading about constants (define('MY_CONSTANT', 'my value'))
>I got convinced that they are pretty usefull.
>
>But now it seems to me, that I can't use them inside a string:
>$my_string = "This is MY_CONSTANT and I love it!";
>
>but that I must take them out:
>$my_string = "This is" . MY_CONSTANT . "and I love it!";
>
>Isn't there a way around?
>And must I suspect more strange things to come with constants?

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.


-- 
Like Music?  http://l-i-e.com/artists.htm


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to