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 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"); 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, 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 Link to comment https://forums.phpfreaks.com/topic/267979-url-manipulation/#findComment-1375132 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.