嗨,我正在为某事创建一个平面文件,想知道如何在 foreach 字符串中获取值?所以我想获取下面的每个 [值] 是我的平面文件的示例......
[value][secret]secret_here[/secret][hello]hello_here[/hello][/value][value][secret]secret_here_new[/secret][hello]hello?[/hello][/value]
所以它会得到 2.. 第一个:[value][secret]secret_here[/secret][hello]hello_here[/hello][/value]
第二个将是[value][secret]secret_here_new[/secret][hello]hello?[/hello][/value]
有没有简单的脚本? 从文件中读取它...
将 [] 替换为字符串中的<>标签 ..并使用 XML 解析器获取值。