Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!not-for-mail From: "M. Strobel" Newsgroups: comp.lang.php Subject: variable replacement in string Date: Thu, 10 May 2012 14:44:08 +0200 Lines: 20 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de j4WbI1WkrTg32sPgus1GeQYfu1XaMGXZyp1RCvF0ovDCmWQryNY3Hg6imLLtYop2Q= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0 Xref: csiph.com comp.lang.php:5913 Hi, I am still searching a function in PHP to execute variable replacement in strings. Other languages do have this, but for PHP I can only find sprintf() and string replace. I have $t = ' - solved - '; $msg = 'The problem is $t'; I want now: echo fxx($msg); print out "The problem is - solved - ". Please don't tell me about $msg = "The problem is $t"; just think of $msg like a template read from a file. /Str.