At the moment, I'm trying to write a script that creates and writes in a configuration file. I want to write in stuff such as:
$hostname = "$variable1";
$dbusername = "$var2";
$dbpassword = "$var3";
I'm using this to write it in.
if (fwrite($handle, $configuration) === FALSE) {
echo "Cannot write to file ($filename)";
exit;
}
Is there anyway I can stick all of that into the $configuration variable? Right now, I'm doing crazy stuff like:
$configuration = '//database information
$hostname = ' . $localhost . ';
$dbusername = ' . $dbusername . ';
$dbpassword = ' . $dbpassword . ';';
But it never ends up printing the variables.