Home >Backend Development >PHP Problem >How to wrap line in post in php

How to wrap line in post in php

藏色散人
藏色散人Original
2020-02-03 09:33:222839browse

How to wrap line in post in php

How to wrap the post in php? How to wrap the value taken out from php in the text!

Recommended video tutorial: "php Programming"

The problem code is as follows:

<?php
$str=$_POST[&#39;name1&#39;].&#39;-&#39;.$_POST[&#39;phone1&#39;].&#39;-&#39;.$_POST[&#39;address&#39;].&#39;-&#39;.$_POST[&#39;express&#39;];
echo $str."<br>";
$fp=fopen("b.txt","a+");
fwrite($fp,$str);//写入
fclose($fp);//关闭
?>

Solution:

$str=$_POST[&#39;name1&#39;].&#39;-&#39;.$_POST[&#39;phone1&#39;].&#39;-&#39;.$_POST[&#39;address&#39;].&#39;-&#39;.$_POST[&#39;express&#39;]."\r\n";

Just add "\r\n" after it. This is the line break character of the text.

The above is the detailed content of How to wrap line in post in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn