Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- * Description of GiantBombApi
- *
- * @author Devil
- */
- class GiantBombApi {
- private $privatekey = '';
- private $baseurl = 'http://api.giantbomb.com/';
- private $resource = '';
- private $filters = array();
- public function __construct() {
- }
- public function getGames($filters){
- $this->resource = 'games';
- //if(!is_array($filters)){ $filters = array($filters); }
- //array_merge($this->filters,array('test'));
- var_dumper($this->filters);
- echo $this->buildUrl();
- }
- private function buildUrl(){
- $url = $this->baseurl . '?api_key=' . $this->privatekey;
- if(count($this->filters) != 0){
- $url .= '&field_list=' . explode(',', $this->filters);
- }
- return $url;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment