PHP adding $ signs into strings without it being a variable? [duplicate]
问题 This question already has answers here : Dollar ($) sign in password string treated as variable (8 answers) Closed 3 years ago . I'm making a setup page where people can write their database login etc and that will then create a config.php file on their webserver with the info but obviously I can't just write $file = fopen("config.php", "w"); fwrite($file, "$dbName = $dbName"); I actually tried $file = fopen("config.php", "w"); fwrite($file, "$" . "dbName = $dbName"); But that doesn't work