<?php
$curl = curl_init();
//$filter = urlencode("filter=(BillAddressCountry eq 'Canada')");
curl_setopt_array($curl, array(
    //CURLOPT_URL => "https://rest.method.me/api/v1/tables/Contacts/count",
    // table is Contacts, method record id is 544
   CURLOPT_URL =>  "https://rest.method.me/api/v1/tables/Contacts?orderby=FirstName",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => array(
        "Authorization: APIKey NjI5OGNkMmM2MjU3OGY0NWQ1MzFiYjQzLjcwQzU0RjVDNTNDNjQzMkU5NTkwQ0EzQTU3MUZBMThG"
    ),
));

$response = curl_exec($curl);

print_r($response);
 echo $response;
//$methodResponseJson = json_decode($response);
//$xmlEncodedResponse = json_decode($response);

/*print_r($xmlEncodedResponse->count);

foreach($xmlEncodedResponse->value as $s) {
    $array = json_decode(json_encode($s), true);
    print_r($array);
}

if($xmlEncodedResponse->count>0){
    echo 'millie';
}*/