arrays - PHP square brackets around braces -



arrays - PHP square brackets around braces -

i having problem array , json_encode. want

"invites": [{ "sent": 0, "accepted": 0 }],

but looks this

"shares": { "sent": 0, "installed": 0 },

currently code using looks this

'shares' => array( 'sent' => 0, 'installed' => 0 ),

does know how go changing this. matt

you have wrap (associative) array within one:

'shares' => array(array( 'sent' => 0, 'installed' => 0, ))

php arrays json

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -