for adding a new line caharacter in a string, concatenate the string with a \n enclosed in double quotes.
eg: $string="new employee"."\n";
fwrite($fptr, $string);
This will write the contents of the string '$string' in to the file and take the cursor to the next line of the file.
So, when you execute the foll: code,
$emp_name="John ";
fwrite($fptr, $emp_name);...
User Profile
Collapse
-
adding a new line character in a string.
Hi friends
I need to write s string into a log file a string each time I run my php script.
How could I write the details into a new line each time I run.
I tried using \n but it is not working.....
eg:
$logdetail= "date: ".$todate.$coun t."values inserted\n";
fwrite($fptr, $logdetail);
THIS IS VERY URGENT Friends
No activity results to display
Show More
Leave a comment: