I want to be able to write PHP varialbes to a text files that will be used to configure other websites. The file will be called using a include() statement and the variables will be written:
$var1 = "test";
$var2 = "test2";
for use in the script. However, I need to be able to have a web page generate this file. My problem is this, if I write a statement to write this to a file it does not write the variable it writes the value of the variable. Like this:
$var1 = "test";
$var2 = "$var1 = '".$var1."';";
echo $var2;
gives the results: test = 'test';
not the expected $var1 = 'test';
Now in other languages, like html, I would get around it by using the ASCII values and having them output what I need without the webserver interpreting them. How do I do that in PHP?
Thanx.