How do I convert JSON-LD extracted from website to a PHP array.
This is the Error I'm getting with the following code---
"Warning: Illegal string offset 'name' in /Users/lightingsystem/sigclub/signatureclub/public/json/json2php.php on line 12 {"
--code--
$json = '{ "@context": "http://schema.org", "@type": "LodgingBusiness", "name":"Breakerwood Suites", "amenityFeature":"A nice place to sleep", "audience":{ "@type":"Audience", "audienceType":"All" }, "checkinTime":"16:00", "checkoutTime":"10:00", "petsAllowed":"No", "availableLanguage":"", "openingHours":"", "paymentAccepted":"", "address":"2323 Bowers St.,New Orleans,LA,USA,69969", "image": "https://www.picturebook.com/resort2.jpg", "telephone":"Resort telephone number: 504/339-4543" }';
$coded = json_encode($json);
$data = json_decode($coded, true);
echo $data['name'];