Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 php 中获取以下数组字段的值?当我对二维数组执行 print_r 函数时,我得到以下结果:
[title] => SimpleXMLElement Object ( ) [date] => SimpleXMLElement Object ( )
如何获取标题和日期的字符串值?我试过用
(细绳)
,但是这不起作用。
您需要访问 SimpleXMLElement 对象的属性。假设您有一个名为 entry 的实例,并且您键入了子标题
(string) $entry->title;