I am new to PHP.
Currently I'd like to get data from a JSON API URL: https://kickass.so/json.php?q=test+category:tv&field=seeders&order=desc&page=2
I have tried the following:
<?php
$query = file_get_contents('https://kickass.so/json.php?q=test+category:tv&field=seeders&order=desc&page=2');
$parsed_json = json_decode($query, true);
foreach ($parsed_json as $key => $value)
{
echo $value['title'];
}
?>
Here I'd want to get the value as:
Title, category, link, hash ect.
But I'm getting this error:
Warning: Illegal string offset 'title' in C:\xampp\htdocs\xxxxx\test.php on line 6
K
Warning: Illegal string offset 'title' in C:\xampp\htdocs\xxxxx\test.php on line 6
h
Warning: Illegal string offset 'title' in C:\xampp\htdocs\xxxxx\test.php on line 6
B
Warning: Illegal string offset 'title' in C:\xampp\htdocs\xxxxx\test.php on line 6
e
Warning: Illegal string offset 'title' in C:\xampp\htdocs\xxxxx\test.php on line 6
1
Notice: Undefined index: title in C:\xampp\htdocs\xxxxx\test.php on line 6