adam291086 Posted September 3, 2008 Share Posted September 3, 2008 i have this url /kunden/homepages/12/d214897219/htdocs/rubberduckiee/rubberduckiee/www.adamplowman.co.uk/random and i want to remove the last part of the url i.e random. and then replace with a variable called $foldername can anyone push me in the right directions? Quote Link to comment Share on other sites More sharing options...
Fadion Posted September 3, 2008 Share Posted September 3, 2008 Try this: <?php $url = "/kunden/homepages/12/d214897219/htdocs/rubberduckiee/rubberduckiee/www.adamplowman.co.uk/random"; $url = substr($url, 0, strrpos($url, '/') + 1); $foldername = 'somefolder'; echo $url . $foldername; ?> Quote Link to comment Share on other sites More sharing options...
adam291086 Posted September 3, 2008 Author Share Posted September 3, 2008 thanks for that i found that i could get away with using explode and then echoing the end($piece) 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.