How to create json code for this? My Php code is <?php $content="asdasd"; $ent1="tag:google.com,2010:buzz-group:1001062849:13"; $object=array(object=>array(content=>$content)); $entries=array(id=>$ent1); $visibility1=array($entries); $visibility2=array(visibility=>(array(entries=>$visibility1))); $a1=json_encode((array(data=> (object=>array(content=>$content)), (visibility=>(entries=>$entries)), ) ) ); PHP: What is wrong with my code?
you need to prepare array correctly so that json_encode will convert the array to a proper json format as needed. Firebug helps on this.