i decoded the json data using php json_decode here is my output with print_r
stdClass Object (
[uv] => stdClass Object (
[current] => stdClass Object (
[class_name] => delta-positive
[display] => 668 [value] => 668 )
[yoy_perc] => stdClass Object (
[class_name] => delta-negative
[display] => -21.23%
[value] => -21.23 )
[mom_perc] => stdClass Object (
[class_name] => delta-negative
[display] => -8.87% [value] => -8.87 )
[yoy] => stdClass Object (
[class_name] => delta-negative
[display] => -180 [value] => -180 )
[mom] => stdClass Object (
[class_name] => delta-negative
[display] => -65
[value] => -65 ) )
[page_title] => example.com 668 UVs for December 2012 | Compete
[rank] => stdClass Object (
[current] => stdClass Object (
[class_name] => delta-positive
[display] => 1,398,481
[value] => 1398481 ) [yoy] => stdClass Object ( [class_name] => delta-negative [display] => -187,667 [value] => -187667 ) [last_month] => stdClass Object ( [class_name] => delta-positive [display] => 1,246,200 [value] => 1246200 ) [mom] => stdClass Object ( [class_name] => delta-negative [display] => -152,281 [value] => -152281 ) [last_year] => stdClass Object ( [class_name] => delta-positive [display] => 1,210,814 [value] => 1210814 ) ) )
i need to get
[display] => 668 [value] => 668 )
668
of this i tried using foreach but no luck. anyone know how to do that using php an efficient way i mean without a loop thank you