~ overflow ~

Tag: json_decode

Fatal error: Cannot use object of type stdClass as array (php json_decode)

by z3n on Feb.17, 2010, under Coding, Notes, Tips & Hints

Problem:

$var=json_decode($_POST['something']);

echo $var['value'];

returns error: Fatal error: Cannot use object of type stdClass as array

Solution:

echo $var->value;

2 Comments :, , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!