Expand Variables in String

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,
<?php
$str = "some string and some \$var plus other stuff";
echo $str."<br />";
$var = "Variable Contents";
echo $str."<br />";
$str_expanded = $str;//would like this to expand $var into $str_expanded
echo $str_expanded."<br />";
?>

Thanks,
dK
`

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux