wmguk Posted March 16, 2008 Share Posted March 16, 2008 hey, I have a string ../../clients/trial/KW-07-05-002.jpg and i want to just get KW-07-05-002 so i need to remove the .jpg and everything including the 4th / is there anything that would do this? I was showed some code earlier for just using 3 letters out of a string, but i cant get that to work for this... Quote Link to comment Share on other sites More sharing options...
wmguk Posted March 16, 2008 Author Share Posted March 16, 2008 nevermind, just sorted with substr Quote Link to comment Share on other sites More sharing options...
Barand Posted March 16, 2008 Share Posted March 16, 2008 <?php $path = '../../clients/trial/KW-07-05-002.jpg'; echo basename($path); //--> KW-07-05-002.jpg ?> 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.