I have the following JSON result and I need to handle it with PHP.
JSON:
{
"name": "abc",
"count": 6,
"frequency": "Manual Crawl",
"version": 3,
"newdata": true,
"lastrunstatus": "success",
"thisversionstatus": "success",
"thisversionrun": "Thu Jul 09 2015 11:46:39 GMT+0000 (UTC)",
"results": {
"collection2": [
{
"property11": {
"href": "http://click.uol.com.br/?rf=meio-ambiente_home-headline-especiais-2colunas-1_1&u=http://noticias.uol.com.br/meio-ambiente/ultimas-noticias/redacao/2015/07/08/lei-mexicana-faz-com-que-tigres-e-leoes-sejam-vendidos-a-preco-de-banana.htm",
"text": "Lei mexicana faz com que tigres e leões sejam vendidos a \"preço de banana\""
}
},
PHP:
<?php
$request = "https://www.kimonolabs.com/api/5bwvka8s?apikey=*****&kimmodify=1";
$response = file_get_contents($request);
$results = json_decode($response, TRUE);
foreach($results['results']['collection2'] as $collection) {
echo "<a href='" . $collection['property11']['href'] ."'>" . $collection['property11']['text'] . "</a><br >";
}
?>
Problem solved!