I get the following string when I use $JSON = var_dump(json_decode($MyJSON, true));
If I echo $JSON:-
array(1) {
["test"]=> array(2) {
[0]=> array(3) {
["subject"]=> array(2) {
["type"]=> string(10) "blank node" ["val"]=> string(4) "_:b0"
}
["predicate"]=> array(2) {
["type"]=> string(3) "IRI" ["val"]=> string(47) "http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
}
["object"]=> array(2) {
["type"]=> string(3) "IRI" ["val"]=> string(25) "http://schema.org/WebPage"
}
}
[1]=> array(3) {
["subject"]=> array(2) {
["type"]=> string(10) "blank node" ["val"]=> string(4) "_:b0"
}
["predicate"]=> array(2) {
["type"]=> string(3) "IRI" ["val"]=> string(28) "http://schema.org/breadcrumb"
}
["object"]=> array(2) {
["type"]=> string(10) "blank node" ["val"]=> string(4) "_:b1"
}
}
}
}
what if I want to echo $JSON->test[0]->predicate->val
what is the right syntax? Sorry I am a beginner. It would be a big help. Thanks in advance.