{"id":302,"date":"2011-03-03T12:18:10","date_gmt":"2011-03-03T11:18:10","guid":{"rendered":"http:\/\/webpiraten.de\/?p=302"},"modified":"2011-03-03T12:18:10","modified_gmt":"2011-03-03T11:18:10","slug":"rekursive-php-glob-funktion-ordnerdateien-rekursiv-nach-pattern-filtern","status":"publish","type":"post","link":"https:\/\/webpiraten.de\/index.php\/php\/rekursive-php-glob-funktion-ordnerdateien-rekursiv-nach-pattern-filtern\/","title":{"rendered":"rekursive php glob funktion &#8211; ordner\/dateien rekursiv nach pattern filtern"},"content":{"rendered":"<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\nprotected function rGlob($pattern = '*', $flags = 0, $path = false)\r\n{\r\n    if (!$path)\r\n    {\r\n        $path = dirname($pattern).DIRECTORY_SEPARATOR;\r\n    }\r\n\r\n    $pattern    = basename($pattern);\r\n    $paths      = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\r\n    $files      = glob($path.$pattern, $flags);\r\n    foreach ($paths as $path)\r\n    {\r\n        $files = array_merge($files, $this-&gt;rGlob($pattern, $flags, $path));\r\n    }\r\n    return $files;\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>protected function rGlob($pattern = &#8218;*&#8216;, $flags = 0, $path = false) { if (!$path) { $path = dirname($pattern).DIRECTORY_SEPARATOR; } $pattern = basename($pattern); $paths = glob($path.&#8217;*&#8216;, GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); $files = glob($path.$pattern, $flags); foreach ($paths as $path) { $files = array_merge($files, $this-&gt;rGlob($pattern, $flags, $path)); } return $files; }<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,54],"tags":[159,232,231,228,230,104,633,92,229],"class_list":["post-302","post","type-post","status-publish","format-standard","hentry","category-php","category-server","tag-dir","tag-directory","tag-file","tag-glob","tag-path","tag-pattern","tag-php","tag-rekursiv","tag-rglob"],"_links":{"self":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/302","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":1,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":303,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/302\/revisions\/303"}],"wp:attachment":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}