Internet Marketing Forum
For Webmasters and Entrepreneurs
|
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 22, 2012, 07:00:25 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
I cannot give you the formula for success, but I can give you the formula for failure--which is: Try to please everybody.
- Herbert Bayard Swope
Home
Search
Login
Register
Privacy
Tweet
Internet Marketing Forum
>
Online Business Discussions
>
Website Design and Maintenance
>
Programming
How do I get rid of a trailing slash on a url ?
0 Members and 1 Guest are viewing this topic.
Pages:
[
1
]
Author
Topic: How do I get rid of a trailing slash on a url ? (Read 764 times)
Izham
Beginner
Joined: Aug 2008
Posts: 21
India
Sep 18, 2008, 02:43:43 PM
#1
I have a site where people submit urls and sometime they submit with a trailign slash like this
http://www.randomsite.com/
How can I get rid of the trailing slash so the url look like this
http://www.randomsite.com
thanks
Monetize your Website or Blog with
Bid
Vertiser
Code4Gold
Administrator
Joined: Jan 2006
Posts: 6215
Administrator
United States
Sep 18, 2008, 08:02:46 PM
#2
this will work...
Code:
$url = 'http://www.randomsite.com/';
$url = (substr($url, strlen($url)-1, 1) == '/') ? $url = substr($url, 0, strlen($url)-1) : $url;
good luck
Latest Blog Post :
8 Tips for Creating a Marketing Buzz
Best Affiliate Programs
Ξ
SocialNews
Ξ
Blogger Forum
Ξ
Wealth Watching
CrackerJack
Junior Member
Joined: Jul 2008
Posts: 63
United States
Dec 01, 2008, 03:51:34 PM
#3
Is it better to remove a trailing slash or add one if there isn't one already ?
New DVD Releases
The TV King
Pages:
[
1
]