Home > Article > Backend Development > 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['name1'].'-'.$_POST['phone1'].'-'.$_POST['address'].'-'.$_POST['express']; echo $str."<br>"; $fp=fopen("b.txt","a+"); fwrite($fp,$str);//写入 fclose($fp);//关闭 ?>
Solution:
$str=$_POST['name1'].'-'.$_POST['phone1'].'-'.$_POST['address'].'-'.$_POST['express']."\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!