newwbiee Posted September 4, 2012 Share Posted September 4, 2012 hello i have url like this www.dozzastudio.com/hr/rezervacija/smjestaj-apartmani-rogic now i wish to make a link button that remove rezervacija/ from url, i know it is not dificult but i cant remember how to wrote that code... thanks for help Quote Link to comment https://forums.phpfreaks.com/topic/267979-url-manipulation/ Share on other sites More sharing options...
spiderwell Posted September 4, 2012 Share Posted September 4, 2012 if its going to be just for this, a simple string replace should do the trick $url = str_replace("rezervacija/", "", "www.dozzastudio.com/hr/rezervacija/smjestaj-apartmani-rogic"); Quote Link to comment https://forums.phpfreaks.com/topic/267979-url-manipulation/#findComment-1375083 Share on other sites More sharing options...
newwbiee Posted September 4, 2012 Author Share Posted September 4, 2012 yes, but last part of url will be diferent every time, Quote Link to comment https://forums.phpfreaks.com/topic/267979-url-manipulation/#findComment-1375117 Share on other sites More sharing options...
spiderwell Posted September 4, 2012 Share Posted September 4, 2012 as long as the part you want to lose or drop is always the same it wont matter Quote Link to comment https://forums.phpfreaks.com/topic/267979-url-manipulation/#findComment-1375132 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.