Home>

The value received from the form is written to the txt file, but it is written as it is without a line break. How can I make a line break?
ID = 1, product = chair, color = mredID = 2, product = chair, color = green

ID = 1, product = chair, color = red
ID = 2, product = chair, color = green
I want to do this.
I tried to insert a line feed code, but I couldn't.

$json = file_get_contents ("php: // input");
$json_data = json_decode ($json, true);
$ID = $json_data ['id'];
$product = $json_data ['product'];
$color = $json_data ['color'];
$str = "ID = {$ID}, product = {$product}, color = {$color}";
$fp = fopen ("send.txt", "a");
   fwrite ($fp, $str);
   explode ("\ n", $fp);
   fclose ($fp);
php