{"id":2079,"date":"2017-01-01T14:51:32","date_gmt":"2017-01-01T14:51:32","guid":{"rendered":"http:\/\/www.kodcafe.com\/?p=2079"},"modified":"2020-10-25T23:28:16","modified_gmt":"2020-10-25T20:28:16","slug":"php-dosya-listeleme","status":"publish","type":"post","link":"https:\/\/www.kodcafe.com\/?p=2079","title":{"rendered":"Php dosya listeleme"},"content":{"rendered":"<p>Php de dosya veya dizin listelemek i\u00e7in yap\u0131lan bir \u00f6rnek;<\/p>\n<p>\u00d6rnek de scandir komutu ile dizini bir dizi ye at\u0131p onu yazd\u0131rma i\u015flemi yapt\u0131k.. Ayr\u0131ca dizinde listelenen dosyalara url linki vermeye \u00e7al\u0131\u015ft\u0131k..<\/p>\n<p>scandir komutu<br \/>\n$files1 = scandir($dir);<br \/>\n$files2 = scandir($dir, 1); 0 artan de\u011fer olarak s\u0131ralar. 1 ise azalan de\u011fer olarak listeler.<\/p>\n<p>print_r($files1);<br \/>\nprint_r($files2);<\/p>\n<pre lang=\"php\"><!--?php\nif(isset($_REQUEST['iz']))\n\t$yol = $_REQUEST['iz'];\nelse\n\t$yol = \"c:\/wamp64\/\";\n    echo \"<br-->\".$yol.$dosya.\"\n\";\n\t\n$dosyalar = scandir($yol,0);\n\t\nforeach($dosyalar as $dosya)\n{\n\tif(is_dir($yol.$dosya))\n\t{\n\t\techo\"<a href=\"?iz=$yol$dosya\/\"> $dosya <\/a> \n\";\n\t}\n\telse\n\t\techo $dosya.\"\n\";\n}\n?&gt;\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Php de dosya veya dizin listelemek i\u00e7in yap\u0131lan bir \u00f6rnek; \u00d6rnek de scandir komutu ile dizini bir dizi ye at\u0131p onu yazd\u0131rma i\u015flemi yapt\u0131k.. Ayr\u0131ca dizinde listelenen dosyalara url linki vermeye \u00e7al\u0131\u015ft\u0131k.. scandir komutu $files1 = scandir($dir); $files2 = scandir($dir, 1); 0 artan de\u011fer olarak s\u0131ralar. 1 ise azalan de\u011fer olarak listeler. print_r($files1); print_r($files2); &#8220;.$yol.$dosya.&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2287,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[108,318,326],"class_list":["post-2079","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-dosya","tag-php-2","tag-php-dizin-listeleme"],"_links":{"self":[{"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=\/wp\/v2\/posts\/2079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2079"}],"version-history":[{"count":1,"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=\/wp\/v2\/posts\/2079\/revisions"}],"predecessor-version":[{"id":2290,"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=\/wp\/v2\/posts\/2079\/revisions\/2290"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=\/wp\/v2\/media\/2287"}],"wp:attachment":[{"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kodcafe.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}