|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-10-19 20:58 UTC] jmyeom at hotmail dot com
[2009-10-20 08:32 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 06:00:01 2025 UTC |
Description: ------------ im used php 5.2.9 after running some tests, it keeps telling me a txt file IS A DIRECTORy.. then fails to open it if this is human error, im sorry and could you point me in the right direction? Reproduce code: --------------- function a($hutpear) { $abc = $hutpear; if ($handle = opendir($abc)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if (!is_file($file)) { a($abc . "/" . $file); } else { echo "$file\n"; } } } closedir($handle); } } a("photos"); Expected result: ---------------- thisisafile.txt Actual result: -------------- br /> <b>Warning</b>: opendir(photos/1/thisisatextdocument.txt) [<a href='function.opendir'>function.opendir</a>]: failed to open dir: Not a directory in <b>/home/y02wals/public_html/test.php</b> on line <b>6</b><br />