Wednesday, 3 July 2019
php - Customzing Eventbrite list, I get unexpected T_FUNCTION, but it works locally
Answer
I'm displaying an events list from my Eventbrite account and when run locally, it works. When I upload it to my live test site, it triggers:
Parse error: syntax error, unexpected T_FUNCTION in ... on line ...
My PHP is as follows and pretty much verbatim from https://github.com/ryanjarvinen/eventbrite.php/blob/master/examples/event-list-example.md
include "Eventbrite.php";
$authentication_tokens = array('app_key' => 'XXXXXXXX',
'user_key' => '123456789');
$eb_client = new Eventbrite( $authentication_tokens );
$events = $eb_client->user_list_events();
$custom_render_function = function($evnt){
$time = strtotime($evnt->start_date);
if( isset($evnt->venue) && isset( $evnt->venue->name )){
$venue_name = $evnt->venue->name;
}else{
$venue_name = 'online';
}
$event_html = "
" . strftime('%a, %B %e', $time) . "
".$evnt->title."
" . strftime('%l:%M %P', $time) . "
" . $venue_name . "
\n";
return $event_html;
}
?>
Can anyone help me see where I've gone wrong?
UPDATE:
It was the version of PHP on the server (5.3). Mine had to be updated by the hosting service but it took only 30secs and this issue was resolved.
Subscribe to:
Post Comments (Atom)
php - file_get_contents shows unexpected output while reading a file
I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...
-
I have an app which needs a login and a registration with SQLite. I have the database and a user can login and register. But i would like th...
-
I would like to split a String by comma ',' and remove whitespace from the beginning and end of each split. For example, if I have ...
-
I got an error in my Java program. I think this happens because of the constructor is not intialized properly. My Base class Program public ...
No comments:
Post a Comment