<?php
$json = '
{
"status": "ok",
"totalResults": 394877,
"articles": [{
"source": {
"id": "engadget",
"name": "Engadget"
},
"author": "https://www.engadget.com/about/editors/kris-holt",
"title": "Uber, PayPal and Walgreens set up a Vaccine Access Fund",
"description": "Anyone can donate and help to cover the cost of rides to COVID-19 vaccination sites.",
"url": "https://www.engadget.com/uber-paypal-walgreens-vaccine-access-fund-donations-150056875.html",
"urlToImage": "https://s.yimg.com/os/creatr-uploaded-images/2021-04/6031a890-9b9d-11eb-93bf-f9d0aa515883",
"publishedAt": "2021-04-12T15:00:56Z",
"content": "Uber\r\n has teamed up with PayPal\r\n and Walgreens\r\n to create a Vaccine Access Fund\r\n with the aim of covering the cost of trips to COVID-19 vaccination sites, especially for people in underserved com… [+1471 chars]"
}, {
"source": {
"id": "engadget",
"name": "Engadget"
},
"author": "https://www.engadget.com/about/editors/jon-fingas",
"title": "Alexa can help you find a COVID-19 vaccination site",
"description": "Amazon Alexa now helps you find nearby COVID-19 vaccination sites, and call them if you have vaccine questions.",
"url": "https://www.engadget.com/amazon-alexa-covid-19-vaccination-site-151440856.html",
"urlToImage": "https://s.yimg.com/os/creatr-uploaded-images/2021-04/73830b10-a1e6-11eb-bdf2-57fabbd8c037",
"publishedAt": "2021-04-20T15:14:40Z",
"content": "Now that every adult in the US is eligible for a COVID-19 vaccine, Amazon wants to make it as simple as possible to get your shots. Alexa now helps you find vaccination sites just by saying \"where ca…[+938 chars]"
}]
}
';
$decoded = json_decode($json, true);
// var_export($decoded['articles']);
foreach ($decoded['articles'] as $article) {
echo $article['title'] . "\n";
}
Uber, PayPal and Walgreens set up a Vaccine Access Fund
Alexa can help you find a COVID-19 vaccination site
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Uber, PayPal and Walgreens set up a Vaccine Access Fund
Alexa can help you find a COVID-19 vaccination site