我正在研究一个文件, 该文件应该替换另一个文件中的变量。 目前我尝试过 :
$File = "$dir/submit.php";
$fh = fopen($File, r ) or die("Couldn t edit the Config-file. Please report to admin.");
$chosendb = str_replace( $chosendb = comments; , $chosendb = wuhuws_$dir; , $chosendb );
fclose($fh);
$dir is a user input. comments is a table in the database that need to replaced with the prefix_$dir.
我做错什么了?