/i", "\r\n",$str);"."/> /i", "\r\n",$str);".">

Home >Backend Development >PHP Problem >How to replace br tag in php

How to replace br tag in php

藏色散人
藏色散人Original
2020-08-05 10:20:203818browse

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 replacementdf250b2156c434f3390392d09b1c9563 is "\r\n"

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

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!

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
Previous article:Can php delete constants?Next article:Can php delete constants?