title: "Cannot use string offset as an array" error
body: <p>Can't figure what is wrong here.  Read what folks are saying here: <a href="http://informationideas.com/news/2006/06/14/fatal-error-cannot-use-string-offset-as-an-array-in/" rel="nofollow noreferrer">http://informationideas.com/news/2006/06/14/fatal-error-cannot-use-string-offset-as-an-array-in/</a>  and here: <a href="https://stackoverflow.com/questions/1873970/cannot-use-string-offset-as-an-array-in-php">Cannot use string offset as an array in php</a></p>
  
  <p>I have <code>print_r()</code>-ed the actual values in <code>$entries</code> (coming from Google Calendar) and they are all fine. </p>
  
  <pre><code>    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' ] 
                       );
       }
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p>Dump of <code>$entries</code>:</p>
  
  <pre><code>Array
  (
      [id] =&gt; http://www.google.com/calendar/feeds/u879een48cs77cp2rv7s05f5ps%40group.calendar.google.com/public/full/aev64a1c7kou9ige6n2mulm8mo
      [published] =&gt; 2009-12-31T15:34:47.000Z
      [updated] =&gt; 2009-12-31T15:34:58.000Z
      [category attr] =&gt; Array
          (
              [scheme] =&gt; http://schemas.google.com/g/2005#kind
              [term] =&gt; http://schemas.google.com/g/2005#event
          )
  
      [category] =&gt; 
      [title attr] =&gt; Array
          (
              [type] =&gt; text
          )
  
      [title] =&gt; Happy New Year!
      [content attr] =&gt; Array
          (
              [type] =&gt; text
          )
  
      [content] =&gt; 
      [link] =&gt; Array
          (
              [0 attr] =&gt; Array
                  (
                      [rel] =&gt; alternate
                      [type] =&gt; text/html
                      [href] =&gt; http://www.google.com/calendar/event?eid=YWV2NjRhMWM3a291OWlnZTZuMm11bG04bW8gdTg3OWVlbjQ4Y3M3N2NwMnJ2N3MwNWY1cHNAZw
                      [title] =&gt; alternate
                  )
  
              [0] =&gt; 
              [1 attr] =&gt; Array
                  (
                      [rel] =&gt; self
                      [type] =&gt; application/atom+xml
                      [href] =&gt; http://www.google.com/calendar/feeds/u879een48cs77cp2rv7s05f5ps%40group.calendar.google.com/public/full/aev64a1c7kou9ige6n2mulm8mo
                  )
  
              [1] =&gt; 
          )
  
      [author] =&gt; Array
          (
              [name] =&gt; New Orleans Parents Guide to Public Schools
          )
  
      [gd:comments] =&gt; Array
          (
              [gd:feedLink attr] =&gt; Array
                  (
                      [href] =&gt; http://www.google.com/calendar/feeds/u879een48cs77cp2rv7s05f5ps%40group.calendar.google.com/public/full/aev64a1c7kou9ige6n2mulm8mo/comments
                  )
  
              [gd:feedLink] =&gt; 
          )
  
      [gd:eventStatus attr] =&gt; Array
          (
              [value] =&gt; http://schemas.google.com/g/2005#event.confirmed
          )
  
      [gd:eventStatus] =&gt; 
      [gd:where attr] =&gt; Array
          (
              [valueString] =&gt; 
          )
  
      [gd:where] =&gt; 
      [gd:who attr] =&gt; Array
          (
              [email] =&gt; u879een48cs77cp2rv7s05f5ps@group.calendar.google.com
              [rel] =&gt; http://schemas.google.com/g/2005#event.organizer
              [valueString] =&gt; New Orleans Parents Guide to Public Schools
          )
  
      [gd:who] =&gt; 
      [gd:when attr] =&gt; Array
          (
              [endTime] =&gt; 2010-01-01
              [startTime] =&gt; 2009-12-31
          )
  
      [gd:when] =&gt; 
      [gd:transparency attr] =&gt; Array
          (
              [value] =&gt; http://schemas.google.com/g/2005#event.opaque
          )
  
      [gd:transparency] =&gt; 
      [gCal:anyoneCanAddSelf attr] =&gt; Array
          (
              [value] =&gt; false
          )
  
      [gCal:anyoneCanAddSelf] =&gt; 
      [gCal:guestsCanInviteOthers attr] =&gt; Array
          (
              [value] =&gt; true
          )
  
      [gCal:guestsCanInviteOthers] =&gt; 
      [gCal:guestsCanModify attr] =&gt; Array
          (
              [value] =&gt; false
          )
  
      [gCal:guestsCanModify] =&gt; 
      [gCal:guestsCanSeeGuests attr] =&gt; Array
          (
              [value] =&gt; true
          )
  
      [gCal:guestsCanSeeGuests] =&gt; 
      [gCal:sequence attr] =&gt; Array
          (
              [value] =&gt; 2
          )
  
      [gCal:sequence] =&gt; 
      [gCal:uid attr] =&gt; Array
          (
              [value] =&gt; aev64a1c7kou9ige6n2mulm8mo@google.com
          )
  
      [gCal:uid] =&gt; 
  )
  </code></pre>