PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
while(false !== ($file = readdir($dir)))
{
$sep = explode('.', $file);
//$num = count($sep);
//$ext = $split[$num - 1];
foreach($sep as $key => $value)
{
echo $value. '<br>';
}
}
As you can see, I can blow the file name up and isolate the extension but not sure what to do next. I can't believe I'm not thinking of a way to do it. Am I approaching this correctly, or should I be using some sort of regular expression, or what? Thanks in advance for any advice.
Rob
Do you mean you are displaying the file and you wish to hide the file extensions? OR do you mean actually delete the extensions ( dont see the point in this )
If it is the first one, why dont you try looking 1 sec in the forums and check out this thread