There is a code

<?php $content = file_get_contents('https://www.domaintally.com/api/v1/whois?access_token=bfb4f4f431f1f366fcff9b30b78fe5d67ee20e97&domain=google.com'); $decode = json_decode($content,true); var_dump ($decode); ?> 

it displays an associative array with a bunch of unnecessary special characters, the tags <br> 'do not work, so I can not understand where is the key in the array to continue working with data

sample output

What could be the problem and how can I put it in a readable form?

    2 answers 2

    And why do var_dump? With json_decode, the data from the string is converted to objects and arrays. Copy what you got from the service in jsonviewer.stack.hu and compose access to the data in the same way as the output.

     $JSON = json_decode($content); $updated_datetime = $JSON->data->{'google.com'}->updated_datetime; 
    • thanks, figured it out, but it's unclear why the <br> tag doesn't work and is displayed as text: - Zin Me
    • something like google.com Registry Registry ID: 2138514_DOMAIN_COM-VRSN Registrar WHOIS Server: whois.markmonitor.com Registrar URL: markmonitor.com Updated Date: 2015-06- 12T10: 38: 52-0700 </ i> - Zin Me
     $content = file_get_contents('https://www.domaintally.com/api/v1/whois?access_token=bfb4f4f431f1f366fcff9b30b78fe5d67ee20e97&domain=google.com'); $decode = json_decode($content,true); print_r($decode);