{"id":584,"date":"2012-10-16T18:02:47","date_gmt":"2012-10-16T18:02:47","guid":{"rendered":"http:\/\/ecodebook.wordpress.com\/2012\/10\/16\/administrator-components\/"},"modified":"2012-10-16T18:02:47","modified_gmt":"2012-10-16T18:02:47","slug":"using-scandir-to-find-folders-in-a-directory","status":"publish","type":"post","link":"https:\/\/blog.mycarts.shop\/?p=584","title":{"rendered":"PHP: Using scandir() to find folders in a directory"},"content":{"rendered":"<p>[code language=&#8221;php&#8221;]<br \/>\n$path = &#8216;extracted&#8217;; \/\/ &#8216;.&#8217; for current<br \/>\nforeach (new DirectoryIterator($path) as $file)<br \/>\n{<br \/>\n    if($file-&gt;isDot()) continue;<\/p>\n<p>    if($file-&gt;isDir()))<br \/>\n    {<br \/>\n        print $file-&gt;getFilename() . &#8216;&lt;br \/&gt;&#8217;;<br \/>\n    }<br \/>\n}<br \/>\n[\/code]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[code language=&#8221;php&#8221;] $path = &#8216;extracted&#8217;; \/\/ &#8216;.&#8217; for current foreach (new DirectoryIterator($path) as $file) { if($file-&gt;isDot()) continue; if($file-&gt;isDir())) { print $file-&gt;getFilename() . &#8216;&lt;br \/&gt;&#8217;; } } [\/code]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-584","post","type-post","status-publish","format-standard","hentry","category-php"],"_links":{"self":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=584"}],"version-history":[{"count":0,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/584\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}