0

I am able to view content displayed from the API but i'm not able to extract the various contents.

my codes are below:

function parseInfo($barcode) {
$url = "https://archive.org/advancedsearch.php?q=$barcode+AND+licenseurl:[http://creativecommons.org/a+TO+http://creativecommons.org/z]&fl[]=identifier,title,mediatype,collection&rows=15&output=json&callback=IAE.search_hits";
    $contents = file_get_contents($url); 
   // $json = json_decode($contents, true);
    return $contents;
}

echo $array = parseInfo($barcode);

//var_dump($json);
for ($i = 0; $i <  count($array); $i++) {
    foreach($array as $values){
echo      $id = ($values[$i]['ID']);
    echo  $Title = ($values[$i]['title']);
      $SubTitle = ($values[$i]['SubTitle']);
      $Description = ($values[$i]['Description']);
      $Image = ($values[$i]['Image']);
      $isbn = ($values[$i]['isbn']);
    }
}

Thanks for your help.

Edited by pritaeas: Moved to PHP.

1
Contributor
1
Reply
13
Views
2 Years
Discussion Span
Last Post by Prince_9
0

I have issues get content from callbacks like:

myCallback({"code":200,"lang":"en-it","text":["Essere, o non essere?","Questo è il problema."]})   

Please help. I want to get the values e.g. lang, text

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.