在 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>推荐哪个更好用,可能是一些标准功能,也可能是一些自定义建议。感谢您的帮助。
1 回答

holdtom
TA贡献1805条经验 获得超10个赞
我会说一些类似的话
$string = "hello there
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
nice to meet you
and others text";
$string = preg_replace( "/<!.*?>/", "", $string );
echo $string;
- 1 回答
- 0 关注
- 146 浏览
添加回答
举报
0/150
提交
取消