Is it possible to expand variables within a string? For example: $var = grape; $str1 = 'The item is a $var'; Now do some operation on $str1, so that the output turns out to be: The item is a grape I am not talking about putting double quotes around the string when it is set or doing some sort of search/replace on a specific variable name. I would like to know if there is a way to get ALL the variables within a string to evaluate after the string is already set. ~Lauxa
This will not work. Lauxa asked for a solution where you first assign $str and then $var, not $var first and then $str.