ballhogjoni Posted June 28, 2007 Share Posted June 28, 2007 I would like to find out how to delete the file exstension when using glob(). Meaning glob("*.php") as $filename) { echo "$filename <br>"; } this will output 1.php 2.php 3.php and so on. How would I just get it to echo 1 2 3 Link to comment https://forums.phpfreaks.com/topic/57633-solved-if-you-are-using-glob-how-do-you-delete-the-file-exstension/ Share on other sites More sharing options...
no_one Posted June 28, 2007 Share Posted June 28, 2007 if you know the extension would be .php then just strip the last 4 characters echo substr($filename,0,strlen($filename)-4); there might be a faster way, but that should work Link to comment https://forums.phpfreaks.com/topic/57633-solved-if-you-are-using-glob-how-do-you-delete-the-file-exstension/#findComment-285298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.