samoht Posted June 18, 2008 Share Posted June 18, 2008 Hello all, I have a simple question - that I used to know how to do bu for got I have a variable $mm_action_url that returns the base url that url strings get attached to. Anyway on my localhost things work fine but live (ex www.mysite.com) there is an extra slash (ie. www.mysite.com//myurlstring/...) What is the php for removing the last slash on my variable? Thanks Quote Link to comment Share on other sites More sharing options...
moderith Posted June 18, 2008 Share Posted June 18, 2008 Hi, Samoht Heres what I would do. $url = 'http://www.mysite.com//'; $newurl = substr($url, 0, -1); echo $newurl; //http://www.mysite.com/ Happy Coding Quote Link to comment Share on other sites More sharing options...
samoht Posted June 18, 2008 Author Share Posted June 18, 2008 Thanks! substr is what I was looking for. Not sure why I forgot 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.