版主,又来求助了。。。这回事是网页返回的XML数据,我不知道为什么不能用simplexml读取,var_dump显示false
echo '#########################'.''; var_dump($xml); echo '#########################'; echo '
'.'
'.'
'.$xml->xsm->nickname;
echo '#########################'.''; var_dump(simplexml_load_string($xml); echo '#########################'; echo '
'.'
'.'
'.$xml->xsm->nickname;
$xml = preg_replace('/!|--/', '', $xml);var_dump(simplexml_load_string($xml));
$xml = preg_replace('/!|--/', '', $xml);var_dump(simplexml_load_string($xml));
//$xml=''; $xml = preg_replace('/!--\?|--/','', $xml); var_dump($xml);
你为什么要自作聪明呢
$xml = preg_replace('/!|--/', '', $xml);var_dump(simplexml_load_string($xml));
$xml = ''.$xml; var_dump(simplexml_load_string($xml));
还是那话,你为什么要自作聪明呢
你为什么要自作聪明呢
那是因为你不给我你的数据
还是那话,你为什么要自作聪明呢
你光截图是没有用的!
你怎么知道其中没有不可打印的字符呢?
那是因为你不给我你的数据
114 wedc 2 116 11601 1062014 v=2014080600 02 11620001 1407488228735 10116226011162288228735 c6959b4eacf7b2f
你光截图是没有用的!
你怎么知道其中没有不可打印的字符呢?
SimpleXMLElement Object( [@attributes] => Array ( [code] => 0000 [msg] => 验证成功abc [trans_time] => 20140808162708 ) [userId] => 114 [nickName] => wedc [userType] => 2 [comId] => 116 [saledptId] => 11601 [refId] => 1062014 [comName] => SimpleXMLElement Object ( ) [domainUrl] => v=2014080600 [comType] => 02 [comShort] => SimpleXMLElement Object ( ) [parentComId] => 11620001 [expirationTime] => 1407488228735 [planText] => 10116226011162288228735 [signatureValue] => c6959b4eacf7b2f)这不是可以吗?
你光截图是没有用的!
你怎么知道其中没有不可打印的字符呢?
SimpleXMLElement Object( [@attributes] => Array ( [code] => 0000 [msg] => 验证成功abc [trans_time] => 20140808162708 ) [userId] => 114 [nickName] => wedc [userType] => 2 [comId] => 116 [saledptId] => 11601 [refId] => 1062014 [comName] => SimpleXMLElement Object ( ) [domainUrl] => v=2014080600 [comType] => 02 [comShort] => SimpleXMLElement Object ( ) [parentComId] => 11620001 [expirationTime] => 1407488228735 [planText] => 10116226011162288228735 [signatureValue] => c6959b4eacf7b2f)这不是可以吗?
SimpleXMLElement Object( [@attributes] => Array ( [code] => 0000 [msg] => 验证成功abc [trans_time] => 20140808162708 ) [userId] => 114 [nickName] => wedc [userType] => 2 [comId] => 116 [saledptId] => 11601 [refId] => 1062014 [comName] => SimpleXMLElement Object ( ) [domainUrl] => v=2014080600 [comType] => 02 [comShort] => SimpleXMLElement Object ( ) [parentComId] => 11620001 [expirationTime] => 1407488228735 [planText] => 10116226011162288228735 [signatureValue] => c6959b4eacf7b2f)这不是可以吗?
已抢23147个
抢已抢117552个
抢已抢139118个
抢已抢6188个
抢已抢35153个
抢已抢7807个
抢