PHP判断数据是否是XML格式
php 判断返回的内容是不是xml格式的
function iss_xml($content){ //判断返回的内容是不是 xml 格式
$xml_parser = xml_parser_create();
$res = xml_parse($xml_parser, $content, true);
xml_parser_free($xml_parser); return $res;
}
if (iss_xml("xml数据")) { echo "真";
} else { echo "假"; }







评论
发表评论: