{"id":325,"date":"2018-01-11T10:04:58","date_gmt":"2018-01-11T10:04:58","guid":{"rendered":"http:\/\/mddir.com\/how-to\/?p=325"},"modified":"2018-01-11T10:04:58","modified_gmt":"2018-01-11T10:04:58","slug":"php-count-function","status":"publish","type":"post","link":"https:\/\/www.mddir.com\/how-to\/php-count-function\/","title":{"rendered":"PHP count() Function"},"content":{"rendered":"<p>The<code> count()<\/code> function is used to return the length of the array.<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>[php]&lt;?php<br \/>\n$cars = array(&quot;Volvo&quot;, &quot;BMW&quot;, &quot;Toyota&quot;);<br \/>\necho count($cars);<br \/>\n?&gt;[\/php]<\/p>\n<p>In the above statement, we are using count function which is &#8220;<code>count($cars)<\/code>&#8221; to get the value of arrays in the echo statement.<\/p>\n<p>It will show the following result<\/p>\n<p><code>3<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The count() function is used to return the length of the array. Example [php]&lt;?php $cars = array(&quot;Volvo&quot;, &quot;BMW&quot;, &quot;Toyota&quot;); echo count($cars); ?&gt;[\/php] In the above<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-325","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/comments?post=325"}],"version-history":[{"count":1,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/325\/revisions"}],"predecessor-version":[{"id":326,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/posts\/325\/revisions\/326"}],"wp:attachment":[{"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/media?parent=325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/categories?post=325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mddir.com\/how-to\/wp-json\/wp\/v2\/tags?post=325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}