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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.