PHP Classes

File: get_json.php

Recommend this page to a friend!
  Classes of Schroetter Christian   PHP Curl HTTP Wrapper   get_json.php   Download  
File: get_json.php
Role: Example script
Content type: text/plain
Description: Sample file
Class: PHP Curl HTTP Wrapper
Send HTTP requests with Curl and cache the results
Author: By
Last change:
Date: 10 years ago
Size: 364 bytes
 

Contents

Class file image Download
<?php
   
include('./curl.wrapper.php');

   
$curl = new CCurlWrapper();
    if(
$curl->InitEx() === false)
        die(
'Unable to init the CURL library' . "\n");

   
// unless this option is set, the request return an HTML page
   
$curl->SetJSON();
   
$json_content = $curl->Exec('http://www.bata.fr/web/store-detail/69640');

   
$json = json_decode($json_content);
   
var_dump($json);
?>