How to replace br tag in php

藏色散人
Release: 2023-03-03 19:36:02
Original
3783 people have browsed it

How to replace the br tag in php: First create a PHP sample file; then replace the br tag with "\r\n" through the regular method, and the statement is "preg_replace("/
/i", "\r\n",$str);". \s*\>

How to replace br tag in php

Recommended: "PHP Video Tutorial"

PHP Regular Replacement"br /> ;" Tag

regular replacement
is "\r\n"

$str =  "1234567<br />1234567<br />1234567";
 
echo preg_replace("/<br\s*\/?>/i","\r\n",$str);
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template