{"id":3170,"date":"2012-05-07T06:25:56","date_gmt":"2012-05-07T06:25:56","guid":{"rendered":"http:\/\/phpcodez.com\/?p=3170"},"modified":"2012-05-07T06:25:56","modified_gmt":"2012-05-07T06:25:56","slug":"array_rand","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/array_rand\/","title":{"rendered":"array_rand"},"content":{"rendered":"<p>The array_rand() function returns a random key from an array, or it returns an array of random keys if you specify that the function should return more than one key.<\/p>\n<p><strong>Example<\/strong><\/p>\n<pre>&lt;?php\n $array = array(\"PHP\", \"ASP\", \"JSP\");\n $keys = array_rand($array, 2);\n echo $array[$keys[0]];\n ?&gt;<\/pre>\n<p><strong>Output<\/strong><\/p>\n<p>PHP<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The array_rand() function returns a random key from an array, or it returns an array of random keys if you specify that the function should return more than one key. Example &lt;?php $array = array(&#8220;PHP&#8221;, &#8220;ASP&#8221;, &#8220;JSP&#8221;); $keys = array_rand($array, 2); echo $array[$keys[0]]; ?&gt; Output PHP<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[54,213,370],"class_list":["post-3170","post","type-post","status-publish","format-standard","hentry","category-php","tag-array","tag-functions","tag-php"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/3170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=3170"}],"version-history":[{"count":0,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/3170\/revisions"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=3170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=3170"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=3170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}