在PHP字符串中如何将文本替换为从符号到符号的空白空间

在 php 中我有一个问题,在某些字符串中我需要先从<!to 中删除>


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">

<cXML xml:lang="en-US"

 payloadID="0c30050@supplierorg.com"

 timestamp="2000-01-08T23:00:06-08:00">

    <Header>

推荐哪个更好用,可能是一些标准功能,也可能是一些自定义建议。感谢您的帮助。


陪伴而非守候
浏览 147回答 1
1回答

holdtom

我会说一些类似的话$string = "hello there&nbsp;<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">nice to meet youand others text";$string = preg_replace( "/<!.*?>/", "", $string );echo $string;
打开App,查看更多内容
随时随地看视频慕课网APP