My code is as below.
$code = json_decode($json,true);
var_dump($code);
echo "1";
echo "Numbers of tweets containing this link : $code->{'count'}"; //some issue here line (x)
but var_dump($code); gives:
array (size=2)
'count' => int 1602
'url' => string 'http://www.youtube.com/watch/?v=yOutxpoXnfg' (length=43)
what is wrong with my code? line x does not show any thing.
asked Dec 24, 2013 at 9:53
user123
5,42516 gold badges79 silver badges126 bronze badges
1 Answer 1
true converts to associative array format for json_decode(), so change to:
echo "Numbers of tweets containing this link :". $code['count'];
answered Dec 24, 2013 at 9:55
Sudhir Bastakoti
100k15 gold badges163 silver badges169 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-php
$code['count'];