使用包含变量的PHP脚本编写PHP文件
我正在使用以下PHP代码编写一个PHP文件: 编写php文件的代码如下: **write.php**使用包含变量的PHP脚本编写PHP文件,php,file,fwrite,Php,File,Fwrite,我正在使用以下PHP代码编写一个PHP文件: 编写php文件的代码如下: **write.php** <?php $myfile = fopen("writePhp.php", "w") or die("Unable to open file!"); $txt = "<?php \n error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED);\n "; fwrite($myfile, $txt); $txtnew =
<?php
$myfile = fopen("writePhp.php", "w") or die("Unable to open file!");
$txt = "<?php \n error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED);\n ";
fwrite($myfile, $txt);
$txtnew = "'$CALENDAR_DISPLAY = 'true';' \n";
fwrite($myfile, $txtnew);
?>
$txtnew='$CALENDAR\u DISPLAY=\'true\';'。“\n”代码>。PHP用值替换双引号字符串中的变量。谢谢Bansi!成功了。我感谢你的时间和帮助。
<?php
error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED);
$CALENDAR_DISPLAY = 'true';
<?php
error_reporting(E_WARNING & ~E_NOTICE & ~E_DEPRECATED);
' = 'true';'