php数组偏移,php – “不能将字符串偏移用作数组”错误

无法想象这里有什么问题.阅读人们在这里说的话:

http://informationideas.com/news/2006/06/14/fatal-error-cannot-use-string-offset-as-an-array-in/和这里:

Cannot use string offset as an array in php

我有print_r() – $entries(来自谷歌日历)的实际值,他们都很好.

foreach ( $entries as $e ) {

$info = array(); // added to see if pre-declaration helps

$info = array(

$e[ 'title' ],

$e[ 'gd:when attr' ][ 'startTime' ],

$e[ 'gd:where attr' ][ 'valueString' ],

$e[ 'content' ]

);

}

我究竟做错了什么?

转储$条目:

Array

(

[id] => http://www.google.com/calendar/feeds/u879een48cs77cp2rv7s05f5ps%40group.calendar.google.com/public/full/aev64a1c7kou9ige6n2mulm8mo

[published] => 2009-12-31T15:34:47.000Z

[updated] => 2009-12-31T15:34:58.000Z

[category attr] => Array

(

[scheme] => http://schemas.google.com/g/2005#kind

[term] => http://schemas.google.com/g/2005#event

)

[category] =>

[title attr] => Array

(

[type] => text

)

[title] => Happy New Year!

[content attr] => Array

(

[type] => text

)

[content] =>

[link] => Array

(

[0 attr] => Array

(

[rel] => alternate

[type] => text/html

[href] => http://www.google.com/calendar/event?eid=YWV2NjRhMWM3a291OWlnZTZuMm11bG04bW8gdTg3OWVlbjQ4Y3M3N2NwMnJ2N3MwNWY1cHNAZw

[title] => alternate

)

[0] =>

[1 attr] => Array

(

[rel] => self

[type] => application/atom+xml

[href] => http://www.google.com/calendar/feeds/u879een48cs77cp2rv7s05f5ps%40group.calendar.google.com/public/full/aev64a1c7kou9ige6n2mulm8mo

)

[1] =>

)

[author] => Array

(

[name] => New Orleans Parents Guide to Public Schools

)

[gd:comments] => Array

(

[gd:feedLink attr] => Array

(

[href] => http://www.google.com/calendar/feeds/u879een48cs77cp2rv7s05f5ps%40group.calendar.google.com/public/full/aev64a1c7kou9ige6n2mulm8mo/comments

)

[gd:feedLink] =>

)

[gd:eventStatus attr] => Array

(

[value] => http://schemas.google.com/g/2005#event.confirmed

)

[gd:eventStatus] =>

[gd:where attr] => Array

(

[valueString] =>

)

[gd:where] =>

[gd:who attr] => Array

(

[email] => u879een48cs77cp2rv7s05f5ps@group.calendar.google.com

[rel] => http://schemas.google.com/g/2005#event.organizer

[valueString] => New Orleans Parents Guide to Public Schools

)

[gd:who] =>

[gd:when attr] => Array

(

[endTime] => 2010-01-01

[startTime] => 2009-12-31

)

[gd:when] =>

[gd:transparency attr] => Array

(

[value] => http://schemas.google.com/g/2005#event.opaque

)

[gd:transparency] =>

[gCal:anyoneCanAddSelf attr] => Array

(

[value] => false

)

[gCal:anyoneCanAddSelf] =>

[gCal:guestsCanInviteOthers attr] => Array

(

[value] => true

)

[gCal:guestsCanInviteOthers] =>

[gCal:guestsCanModify attr] => Array

(

[value] => false

)

[gCal:guestsCanModify] =>

[gCal:guestsCanSeeGuests attr] => Array

(

[value] => true

)

[gCal:guestsCanSeeGuests] =>

[gCal:sequence attr] => Array

(

[value] => 2

)

[gCal:sequence] =>

[gCal:uid attr] => Array

(

[value] => aev64a1c7kou9ige6n2mulm8mo@google.com

)

[gCal:uid] =>

)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值