Parsing variables in a string
Posted: Fri Dec 22, 2006 8:08 am
Hey all, I know you can parse variables in a string by encapsulating it in double quotes instead of singles, but I have a problem. I'm obtaining the string from file_get_contents(). Thus:
Code: Select all
<?php
$var = get_file_contents(input.php);
exit;
</php
forces $var into a string. But there are variables in the input file! It doesn't parse them, so if I echo $var, it just reads something like My name is $var because it's acting like the string is encapsulated in single quotes! How can I change this behavior? I can't find any way to do it, and I need to parse the variables.