UNIVEX-EB1021:~$ php -a
Interactive mode enabled
php > $xst = '<?xml version="1.0" encoding="utf-8"
php ' ?><RESULT><SEQ>00000000000100699777</SEQ><ERR>0</ERR></RESULT>';
php > $xm = new SimpleXmlElement($xst);
php > print_r($xm);
SimpleXMLElement Object
(
[SEQ] => 00000000000100699777
[ERR] => 0
)
php > echo "{$xm->SEQ}\n";
00000000000100699777
php > echo "{$xm->ERR}\n";
0
php > ^D
UNIVEX-EB1021:~$ php -v
PHP 5.5.9-1ubuntu4.11 (cli) (built: Jul 2 2015 15:23:08)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
就算你的 php 不支援 -a,写程式应该得到相同结果才对