Search code examples
phpgoogle-apigoogle-calendar-apizend-gdata

Google calendar api event feed not giving "where"


I am using the zend google api library to retrieve a list of event from a public calendar. I am successfully able to retrieve the title, when, and content, but where is an empty array. Any documentation that I have found in the past 3 hours from Google, Zend or otherwise is terrible and does not give a list of possible values. The only documentation I can find on the location of the event is how to set it if you are creating an event.

How do I access the location?

<?php
            foreach ($eventFeed as $event) :
                ?>
                <li>
                    <div class="event_title">
                        <?php echo $event->title->text;?>
                    </div>
                    <div class="event_time">
                        <?php echo date('h:ia', strtotime($event->when[0]->startTime));?>
                    </div>
                    <div class="event_location">
                        <?php echo $event->where?>
                    </div>
                    <div class="event_description">
                        <?php echo $event->content->text?>
                    </div>
                </li>
                <?php
            endforeach;
            ?>

Solution

  • $where=$event->Where;
        foreach($where as $eventplace)
        {
            echo $eventplace;
        }
    

    It will give you location.

    The main reason is that it gives the location value in array so we have to find it out manually....