【发布时间】:2016-07-11 16:53:35
【问题描述】:
我正在尝试从 php 创建一个新的 php 文件。
我的最终 php 文件必须如下所示:
<?
$text_1 = "Text";
$text_2 = "Banana";
?>
其实我生成的php是这样的:
$file = fopen("../lang/_____fr-CA.php", "w") or die("Unable to open file!");
<?
$datas .= '$text_1 = "Text"; \n ';
$datas .= '$text_2 = "Banana"; \n ';
$datas = nl2br("<? \n".$datas."\n ?>");
fwrite($file, $datas);
fclose($file);
?>
我的问题是生成的 php 看起来像这样:
<? <br />
$text_1 = "Text"; \n$text_2 = "Banana"; \n<br />
?>
【问题讨论】:
标签: php