Thursday 15 March 2012

Google Calendar Save Events to PHP Array -



Google Calendar Save Events to PHP Array -

i attempting of events google calendar , save them php array. part of bigger application don't have access to.

my effort uses coreylib (http://github.com/collegeman/coreylib). library allows me list of events, not save them in array.

<?php require_once('coreylib.php'); $api = new clapi('https://www.google.com/calendar/feeds/60vebk6jve9fntibh4vh6fr45k%40group.calendar.google.com/public/full'); if ($feed = $api->parse()) { $feed->inspect(); } $datelist = array(); ?> <ol> <?php if ($feed = coreylib('https://www.google.com/calendar/feeds/60vebk6jve9fntibh4vh6fr45k%40group.calendar.google.com/public/full')) { ?> <?php foreach($feed->get('entry') $entry) { ?> <li><?php echo $entry->get('when@starttime') ?> <?php // tricky part. can't save event array item. $datelist[] = $entry->get('when@starttime'); ?> </li> <?php } ?> <?php } ?> </ol> <br /><br /> <?php print_r($datelist); ?>

try following:

int array_push ( $datelist , $variable_having_value_to_be_pushed )

array_push() treats array stack, , pushes passed variables onto end of array. length of array increases number of variables pushed.

source: http://php.net/manual/en/function.array-push.php

php google-calendar

No comments:

Post a Comment