封装 PHP 函数 判断返回的内容是不是有效 XML 格式 <?php /** * php 判断返回的内容是不是xml格式的 */ function is_xml($content){ //判断返回的内容是不是 xml 格式 $xml_parser = xml_parser_create(); $res = xml_parse($xml_parser,$content,true); xml_parser_free($xml_parser); return $res; }