On Wed, Jul 29, 2009 at 6:47 PM, Daniel Kolbo wrote:
> Jonathan Tapicer wrote:
>> Use eval, like this:
>>
>> eval('$str_expanded = "' . str_replace('"', '\\"', $str) . '";');
>>
>> The str_replace is used because you could have a " inside $str and it
>> would break the string, if you are sure the $
Jonathan Tapicer wrote:
> Use eval, like this:
>
> eval('$str_expanded = "' . str_replace('"', '\\"', $str) . '";');
>
> The str_replace is used because you could have a " inside $str and it
> would break the string, if you are sure the $str has no " inside you
> can omit it.
>
> Jonathan
>
> O
Use eval, like this:
eval('$str_expanded = "' . str_replace('"', '\\"', $str) . '";');
The str_replace is used because you could have a " inside $str and it
would break the string, if you are sure the $str has no " inside you
can omit it.
Jonathan
On Wed, Jul 29, 2009 at 5:43 PM, Daniel Kolbo w
Hello,
Is it possible to force a string to expand variable names after the
string has been set and before the variable's been defined without
having to do a string replace or preg_replace?
for example,
";
$var = "Variable Contents";
echo $str."";
$str_expanded = $str;//would like this to expand $
4 matches
Mail list logo