php PHP的正则表达式从XML中获取指定标签中的内容

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php PHP的正则表达式从XML中获取指定标签中的内容相关的知识,希望对你有一定的参考价值。


public function request($name)
{
    preg_match("/\<$name.*?>(.*?)<\/$name\>/iu", $this->xmlstr, $matches);
    return isset($matches[1]) ? $matches[1] : null;
}

以上是关于php PHP的正则表达式从XML中获取指定标签中的内容的主要内容,如果未能解决你的问题,请参考以下文章