Panjabel Posted June 30, 2007 Share Posted June 30, 2007 $string = "photo.jpg"; i want to add "_t2" before the extension .jpg: like $string = "photo_t2.jpg"; can you help me please Quote Link to comment Share on other sites More sharing options...
no_one Posted June 30, 2007 Share Posted June 30, 2007 $string = str_replace('.','_t2.',$string); That should work. Quote Link to comment Share on other sites More sharing options...
chocopi Posted June 30, 2007 Share Posted June 30, 2007 I was gonna suggest something similar, but that will only work if there is one "." ~ Chocopi Quote Link to comment Share on other sites More sharing options...
no_one Posted June 30, 2007 Share Posted June 30, 2007 True, but they never mentioned that they'd need it to work in cases where filename is not known. :S Quote Link to comment Share on other sites More sharing options...
Panjabel Posted June 30, 2007 Author Share Posted June 30, 2007 cool 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.