Однако сейчас я получаю следующее
Код: Выделить всё
"Warning: Trying to access array offset on value of type null"
"Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given"
Код: Выделить всё
$file = '
{
"total_entries" : 912,
"jobs": [
{
"title": "Business Intelligence VBA Developer",
"logo": "https://myurl/logo/big/b7499f6a58974564859a309442fc4b52",
"type": [
"Permanent"
],
"salary": "£49500 - £66000/annum",
"expiry_date": "2024-11-21T01:08:04Z",
"applications": "10+",
"posted": "2024-10-24T01:08:04Z",
"id": 222536673,
"hl_title": "Business Intelligence VBA \u003Cem\u003EDeveloper\u003C/em\u003E",
"url": "/job/222536673/Business-Intelligence-VBA-Developer?hlkw=Developer&s=101899",
"location": "KT5 9NU",
"description": "Business Intelligence VBA \u003Cem\u003EDeveloper\u003C/em\u003E. Summary. £49,500* up to £66,000 per annum* | 35 days holiday (pro rata) | 10% in-store discount | Pension scheme. Everyone who works at Lidl brings something unique to the table - but we also have a whole lot in common. Were proactive, reliable and …",
"agency": {
"url": "https://myurl/list-jobs/226772/Lidl",
"title": "Lidl",
"type": "Corporate"
}
}
]
}';
$data = json_decode($file, true);
$specified = $data['total_entries'];
$total_entries = count($data['jobs']);
echo $specified.'
';
echo "Total Entries: " . $total_entries;
Будем с благодарностью принимать любые идеи
Подробнее здесь: https://stackoverflow.com/questions/791 ... -json-data