|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-09 10:56 UTC] moriyoshi@php.net
[2003-02-20 08:08 UTC] sniper@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Here's the code I'm working with: function getFilePath($filename,$path=''){ if(empty($path)){ $path=$this->basedir; } echo $path."<br>"; if($dir=@opendir($path)){ while(false!==($file=readdir($dir))){ if(!in_array($file,$this->remove_array)){ $file_path=$path."/".$file; if(is_file($file_path)){ if(strtolower($file)==strtolower($filename)){ $this->found_path=$file_path; return $file_path; } }elseif(is_dir($file_path)){ $this->getFilePath($filename,$file_path); } } } } closedir($dir); //return $this->found_path; } Where it starts in one dir, and goes until it finds a file - then, when it does, it's supposed to return that path value - but it doesn't. It keeps going through the rest of the directories without stopping at the "return"