PHP & Javascript : Using Javascript dictionary in php
<p>I am storing some key and values in javascript dictionary </p>

<pre><code>var list_of_addressbook_entries = {};
</code></pre>

<p>and i am passing that dictionary on a php page </p>

<p>But when i am trying to get the key and value of javascript dict like </p>

<pre><code> $attendee_list = $_POST['dict_of_externals'];
   $shared_attendee_list = $_POST['list_of_shared_addressbook_entries'];
   $org_attendee_list = $_POST['dict_of_org_users'];

   echo json_encode($attendee_list);


   return false;
</code></pre>

<p>As a response i am getting only <code>"[object Object]"</code></p>

<p>i just want to know the way how can i extract the values in php ?</p>

<p>in my javascript </p>

<pre><code>for(key in list_of_addressbook_entries)
        {
          alert("key " + key
             + " has value "
          + list_of_addressbook_entries[key]);
        }
</code></pre>

<p>is printing the key and values </p>

<p>Updated </p>

<pre><code>var list_of_addressbook_entries_privilege = [];
function showDetails(guest_name){
        var user_name = "&lt;?php echo $_SESSION["user_name"]; ?&gt;" ;
        var name = prompt("Please use M for moderator and A for attendee", "Type you name here");
        if (!name == null &amp;&amp; !name== '' || name == 'M' || name == 'A'){

        var ahtml='&lt;div  id ="div_id_'+guest_name+'" onclick =remove_addressbook_user("'+guest_name+'") class="addr_list" style="display:block; background: none repeat scroll 0% 0% peachpuff;margin-bottom:1px;"&gt;'
        ahtml = ahtml + '&lt;span&gt;'+guest_name+'&lt;/span&gt;'
        ahtml = ahtml + '&lt;input type = "hidden" id ="user_id_'+guest_name+'"   value = "'+guest_name+'"  /&gt;&lt;/div&gt;'
        $(".address_book_list").append(ahtml);
        $("#div_id_"+guest_name).hide();
        list_of_addressbook_entries[guest_name] = name ;
        }
        else{
            alert("You have entered the worong value ");
            return false;
        }
        $('#dict_of_externals').val(list_of_addressbook_entries);

        for(key in list_of_addressbook_entries)
        {
          alert("key " + key
             + " has value "
          + list_of_addressbook_entries[key]);
        }


}
</code></pre>
