Write to File With Line breaks?

Links for php scripts

Moderators: macek, egami, gesf

sigix
php-forum Active User
php-forum Active User
Posts: 364
Joined: Mon Jul 14, 2003 9:39 pm
Location: /Earth/Xion

Postby sigix » Sun Oct 26, 2003 12:09 am

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);
?>

Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests

cron