show data json in html table imported in link using php


I want to be able to show in an html table the following elements that a json is bringing me but I have no idea how to do it ...

// Initialize cURL and make the request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '[][]=Stat.clicks&fields[]=Stat.conversions&fields[]=Stat.payout&sort[]=asc');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

// Decode the response into a PHP associative array
$response = json_decode($response, true);

// Make sure that there wasn't a problem decoding the repsonse
    throw new RuntimeException(
        'API response not well-formed (json error code: '.json_last_error().')'

// Print out the response details or, any error messages
if(isset($response['response']['status']) && $response['response']['status']===1){
    echo 'API call successful';
    echo PHP_EOL;
    echo 'Response Data: <pre>'.print_r($response['response']['data'], true).'';
    echo PHP_EOL;
    echo 'API call failed'.(isset($response['response']['errorMessage'])?' ('.$response['response']['errorMessage'].')':'').'';
    echo PHP_EOL;
    echo 'Errors: <pre>'.print_r($response['response']['errors'], true).'';
    echo PHP_EOL;

the data I want to bring me is generated by the link


Any guide to where to start =?

asked by Juan Ortiz 29.11.2018 в 05:14

0 answers