Write to File With Line breaks?

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
try this code,
is it giving you the required result
<?php
$fp=fopen("test.txt","w+");
$msg="HEllo\nhow are you\nand what are you doing\n";
$msg.="line\n";
fwrite($fp,$msg,strlen($msg));
fclose($fp);
?>
 
Back
Top