这是我的代码:
$xml2 = (array) simplexml_load_string($xml_file);
使用 print_r 这是我的数组:
Array
(
[program] => Array
(
[0] => SimpleXMLElement Object
(
[date] => asgasg sgasgasg
[start_time] => asdg asg
[leadtext] => as asdgsagsdgasgasgd
[name] => as gsadgasg
[bline] => sag asdg
[synopsis] => asg asga sdg
[url] => asg sdgasgasg
)
[1] => SimpleXMLElement Object
(
[date] => sgasgasg1
[start_time] => asg1
[leadtext] => as1
[name] => gsadgasg1
[bline] => asdg1
[synopsis] => sdg1
[url] =>sdgasgasg1
)
)
)
我怎样才能回显从第二个 SimpleXMLElement 获取 [date] 的内容(在上面的示例中是sgasgasg1 )