{"id":613,"date":"2012-07-20T11:02:07","date_gmt":"2012-07-20T11:02:07","guid":{"rendered":"http:\/\/codeatelier.wordpress.com\/?p=103"},"modified":"2012-07-20T11:02:07","modified_gmt":"2012-07-20T11:02:07","slug":"storing-and-retrieving-array-in-cookie","status":"publish","type":"post","link":"https:\/\/codethataint.com\/blog\/storing-and-retrieving-array-in-cookie\/","title":{"rendered":"Storing and Retrieving  array in Cookie"},"content":{"rendered":"<p><strong>Storing Array In Cookie and Retrieving it<\/strong><\/p>\n<pre>\n  $arrNames= array('Name'=&gt;'Mugil',\n               \t   'Email'=&gt;'Mugil@cse.com', \n\t           'ContactNo'=&gt;'9962945097');\n  \n  $strDetails = implode(',', $arrNames);\n\n  setcookie('Details', $strDetails, time()+ 3600*24);\n\n  if(isset($_COOKIE['Details']))\n  {\n    $arrDetails = explode(',', $_COOKIE['Details']);\n\t\n    for($i=0;$i&lt;count($arrDetails);$i++)\n     print $arrDetails[$i].&quot;<br \/>\";\t\t\t\n }\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Storing Array In Cookie and Retrieving it $arrNames= array(&#8216;Name&#8217;=&gt;&#8217;Mugil&#8217;, &#8216;Email&#8217;=&gt;&#8217;Mugil@cse.com&#8217;, &#8216;ContactNo&#8217;=&gt;&#8217;9962945097&#8217;); $strDetails = implode(&#8216;,&#8217;, $arrNames); setcookie(&#8216;Details&#8217;, $strDetails, time()+ 3600*24); if(isset($_COOKIE[&#8216;Details&#8217;])) { $arrDetails = explode(&#8216;,&#8217;, $_COOKIE[&#8216;Details&#8217;]); for($i=0;$i&lt;count($arrDetails);$i++) print $arrDetails[$i].&quot;&#8221;; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93],"tags":[],"class_list":["post-613","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/613","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/comments?post=613"}],"version-history":[{"count":0,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/posts\/613\/revisions"}],"wp:attachment":[{"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/media?parent=613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/categories?post=613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codethataint.com\/blog\/wp-json\/wp\/v2\/tags?post=613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}