提示出错。 Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 15: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xD5 0xDB 0x2A 0x0D in D:\happy7tNew\search\3.php on line 37Warning: simplexml_load_string() [function.simplexml-load-string]: @550*6.50��* in D:\happy7tNew\search\3.php on line 37Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in D:\happy7tNew\search\3.php on line 37 Array ( [0] => )
@2011-10-19
@9869@ZH@738
@07:50@09:25
@0
@1
@0
@1
@850
@50
@70
@550*6.50折*
@9CE4AD01425AA25$
SZX@KHN
@2011-10-19
@3583@CZ
@321
@08:00
@09:30
@0
@0
@0
@1
@850
@50
@70
@550*6.50折*
@09C4132D4A763A2EE再清楚点就是将上述红黄蓝三个页面的代码储存一起并且分割,走过路过的高手们指点一下啊
...自己写吧。
$output = curl_exec($ch);
这个output变量不是么?
这个储存不了,一echo就提示
无法显示 XML 页。
使用 XSL 样式表无法查看 XML 输入。请更正错误然后单击 刷新按钮,或以后重试。
--------------------------------------------------------------------------------文档的顶层无效
而且最后的值是1
$xml=<<<XML
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://www.XXXXXXX.org/">
0!SZX!KHN!2011-10-19!
SZX@KHN
@2011-10-19
@9869@ZH@738
@07:50@09:25
@0
@1
@0
@1
@850
@50
@70
@550*6.50折*
@9CE4AD01425AA25
$
SZX@KHN
@2011-10-19
@3583@CZ
@321
@08:00
@09:30
@0
@0
@0
@1
@850
@50
@70
@550*6.50折*
@09C4132D4A763A2EE
!</string>
XML;
$con = simplexml_load_string($xml);
$arr=explode('$',$con);
print_r($arr);
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 15: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xD5 0xDB 0x2A 0x0D in D:\happy7tNew\search\3.php on line 37Warning: simplexml_load_string() [function.simplexml-load-string]: @550*6.50��* in D:\happy7tNew\search\3.php on line 37Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in D:\happy7tNew\search\3.php on line 37
Array ( [0] => )
回答的太对了,十分感谢。但是$xml=<<<XML XML;之间的数据怎么放进去了,XML是返回的数据,总不可能人肉贴进去吧?
但是变量还是保存在 $output中了。
$URL="http://xxx/Service.asmx/getFormatValuesV2?";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"$URL");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "u=demo&sc=SZX&ec=KHN&sd=2011-10-19&ed=2011-10-29&showround=&f=&t=");
$output = curl_exec($ch);
curl_close ($ch);$con = simplexml_load_string($output);
$arr=explode('$',$con);
print_r($arr);