Function calls and strings

From: Date: Thu, 11 Sep 2003 15:16:02 +0000
Subject: Function calls and strings
Groups: php.general 
Request: Send a blank email to php-general+get-162308@lists.php.net to get a copy of this message
Hello. PHP possesses what the manual calls "complex syntax" for allowing one to include non-trivial expressions in strings, e.g.: $s = "The result is {$results[$foo]}."; I seek to find out whether PHP also has a syntax to allow function calls within a string, so that explicit concatenation is not needed. E.g.: something like: $s = "The result is {getResult($foo)}."; as opposed to $s = "The result is " . getResult($foo) . "."; If that is not possible, I would appreciate if someone could suggest the rationale. Thank you, -- Ney André de Mello Zunino

« previous php.general (#162308) next »