Jump to content

How to apend data to a new line, in a text file


leeharvey09

Recommended Posts

i have a small script that writes input to a text file, i want each new record to be added to a newline, so its easy to read, like this,

 

tom hanks          [email protected]          I have seen news stories about implants which will help the

jim jones             [email protected]       Jaycee Dugard kept a journal during 18 years of captivity

tim dog                [email protected]          Former President Bill Clinton had two stents placed in one

mark brown        [email protected]    Thursday. Chief cardiologist Allan Schwartz with New York

 

 

but my script produces this in the text file.

 


$name = $_POST['sendNamehiddenField'];
$email = strtolower($_POST['sendEmailhiddenField']);
$message = $_POST['sendMessagehiddenField'];

$feedBackRecords = array($name,$email,$message);
$spaceImplode = implode("          ",$feedBackRecords);
$file = "feedBackData.txt";
file_put_contents($file,$spaceImplode,FILE_APPEND);

 

tom hanks          [email protected]          I have seen news stories about implants which will help the blind see.jim jones          [email protected]          Jaycee Dugard kept a journal during 18 years of captivitytim dog          [email protected]          Former President Bill Clinton had two stents placed in one of his coronary arteries onmark brown          [email protected]          Thursday. Chief cardiologist Allan Schwartz with New York Presbyterian Hospital says

 

 

any help will be great thanks

 

cheers

Lee Harvey[/size][/size]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.