<?php
$tags = array("art", "emotion");
$serialized = serialize($tags);
$deserialized = unserialize($serialized);
echo $serialized. "\n";
echo $deserialized[0]. "\n";
$json = '{
"success": {
"total": 1
},
"contents": {
"quotes": [
{
"quote": "The artist is a receptacle for the emotions that come from all over the place: from the sky, from the earth, from a scrap of paper, from a passing shape, from a spiders web.",
"length": "174",
"author": "Pablo Picasso",
"tags": [
"art",
"artist",
"emotion"
],
"category": "art",
"date": "2017-04-12",
"permalink": "https://theysaidso.com/quote/MO7LGV07dZujWjUR2_WCXQeF/pablo-picasso-the-artist-is-a-receptacle-for-the-emotions-that-come-from-all-ove",
"title": "Art quote of the day ",
"background": "https://theysaidso.com/img/qod/fractal_arabesque_loops.jpg",
"id": "MO7LGV07dZujWjUR2_WCXQeF"
}
],
"copyright": "2017-19 theysaidso.com"
}
}';
//echo $json."\n";
$jsonObject = json_decode($json);
echo var_dump($jsonObject->{"success"});
echo "-----------------------------------";
a:2:{i:0;s:3:"art";i:1;s:7:"emotion";}
art
object(stdClass)#1 (1) {
["total"]=>
int(1)
}
-----------------------------------
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
a:2:{i:0;s:3:"art";i:1;s:7:"emotion";}
art
object(stdClass)#1 (1) {
["total"]=>
int(1)
}
-----------------------------------