treeleaf20 Posted December 4, 2009 Share Posted December 4, 2009 All, I have the two following URLs: http://photos-c.ak.fbcdn.net/photos-.../n47602684_30183939_7359.jpg http://photos-c.ak.fbcdn.net/photos-.../n38801267_31342580_3128.jpg Basically they always end in a .jpg, .gif or .png and then I always want to take it from the the .jpg, .gif or .png to the previous / So for this I'd like to grab: n38801267_31342580_3128.jpg and n47602684_30183939_7359.jpg What is the best way to do this? Thanks in advance! Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted December 4, 2009 Share Posted December 4, 2009 try: <?php $file = '/path/to/n38801267_31342580_3128.jpg'; echo pathinfo ($file, PATHINFO_FILENAME); ?> EDIT: uses pathinfo() Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted December 4, 2009 Share Posted December 4, 2009 basename() Quote Link to comment Share on other sites More sharing options...
mrMarcus Posted December 4, 2009 Share Posted December 4, 2009 aaah, man .. my bad. thought OP was asking to strip the extension. i'm calling it a day. 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.