Trimming a URL portion

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mahi130
Forum Newbie
Posts: 7
Joined: Tue Mar 08, 2011 2:19 am

Trimming a URL portion

Post by mahi130 »

Iam a php newbie.i have a url like
"http://localhost/cs/ "
I need to cut the "/cs/" portion from the above mentioned url.How can i do this?
Anyone please help.
Thanks.......
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Trimming a URL portion

Post by pickle »

What do you mean by "cut"?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Trimming a URL portion

Post by John Cartwright »

use $_SERVER['HTTP_HOST'] ?
mahi130
Forum Newbie
Posts: 7
Joined: Tue Mar 08, 2011 2:19 am

Re: Trimming a URL portion

Post by mahi130 »

Thanks for the reply..
Post Reply