View Single Post
Old 06-17-2009, 08:51 AM   #1 (permalink)
rguy84
The Contributor
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
rguy84 is on a distinguished road
Default 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())
__________________
Ryan | Blog | Twitter
Send a message via AIM to rguy84 Send a message via MSN to rguy84 Send a message via Yahoo to rguy84 Send a message via Skype™ to rguy84
rguy84 is offline  
Reply With Quote