I'm sending my posted data to the server as a block of JSON data due to its size. Once it arrives, I decode it using json_decode
and then go about my business. The problem I've run into is I can't access values at indexes. When I print_r
the array it shows everything, but trying to echo the value at an index shows nothing. Why doesn't the echo work? Here's what I'm trying:
$content = json_decode($_POST['result']);
print_r($content); //works
echo $content["rowCount"]; //doesn't work
Here's what print_r($content);
prints out:
stdClass Object ( [prodName] => [company] => [runTime] => [adLine] => [vintage] => [agency] => [vimeo] => [notes] => [displayOrder] => [infoId] => [prodName1] => test [company1] => test [runTime1] => 0 [adLine1] => [vintage1] => 0 [agency1] => [vimeo1] => https://vimeo.com/ [notes1] => [displayOrder1] => 0 [infoId1] => 339 [rowCount] => 1 )