06-17-2009, 08:51 AM
|
#1 (permalink)
|
|
The Contributor
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
|
Splitting Filenames
I have a directory that will hold word docs of meeting minutes. The word doc titles will be "Minutes 1-21-2009.doc". I would basically I want the names to be "Minutes - 1-21-2009". Right now my code looks like:
PHP Code:
$min_dir = blah;
if(is_dir($min_dir)){
if($min = opendir($min_dir)){
while(($file = readdir($min)) !== false){
if ($file != "." && $file != "..") {
list($fliemin,$fileextra) = explode(' ',$file);
list($filedate,$fileext) = explode('.',$fileextra);
"<li><a href=\"minutes/$file\">Minutes - $filedate</a></li>";
}
}
closedir($min);
}
}
This works fine, I just wanted to see if there was a cleaner way to make this a bit cleaner (the part in the inner most if())
|
|
|