【发布时间】:2013-05-07 13:50:12
【问题描述】:
我有一个名为 Notifications.txt 的文本文件。它包含某些内容组。每个组都以<grouptitle> 标签开始,以</grouptitle> 标签结束{grouptitle changes>
例如这里是一个示例内容
<schedule> New schedule for Mathematics 307 has been emailed to students </schedule>
<convocation> The convocation of 34th batch will be on may 3rd </convocation
现在我想删除从<schedule>到</schedule>的数据,包括使用php网站的标签。
我该怎么做?而且我的时间有点短,如果你们也可以发布示例代码,我将不胜感激
非常感谢
【问题讨论】:
-
这听起来像 XML。您可以使用 SimpleXML 之类的文件解析文件,也可以使用 preg_replace 删除内容。