私はPHPから新しいPHPファイルを作成しようとしています。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 />
?>
あなたは下のリンクをチェックしてくださいすることができ:[http://stackoverflow.com/questions/3066421/writing-a-new-line-to-file-in-php](http://stackoverflow.com/questions/3066421/writing-a-new-line-to-file-in-php) –