You need to change your json_decode
to
$parsed_json = json_decode($json_string);
Since, you pass the true
the $parsed_json
will become an array. So remove the true
flag.
and access it like ...
$text = $parsed_json->query->pages->{1332160}->extract;
What if 1332160
is not known ?
Proceed like this..
foreach($parsed_json->query->pages as $k)
{
echo $k->extract;
}