0
I have doubt in php ?
I want to create new text file through php in which I want every string in new line.why \n is not working?
3 RĂ©ponses
+ 1
Please show your code here so that we can help you
https://www.sololearn.com/post/75089/?ref=app
0
<?php
var_dump($_POST);
session_start();
if (isset($_SESSION['username']))
{
$pth=$_SESSION['username'].'/'.$_POST['title'];
$fop=fopen($pth,'a');
fwrite($fop,$_POST['article']);
$pth=$_SESSION['username'].'/filedetail.txt';
$fop=fopen($pth,'a+');
$str='\n'.$_POST['title'];
fwrite($fop,$str);
}
?>
0
this is link https://code.sololearn.com/w2XDG0mCvmX