Forum Moderators: coopster

Message Too Old, No Replies

Parsing an URL

Spliting up an URL into a filename and the directory

         

chriswragg

7:09 am on Apr 17, 2005 (gmt 0)

10+ Year Member



Hi

I want a PHP script that will for example split
http://example.com/dir/index.htm
into

http://example.com/dir
and
index.htm

It also needs to split up an URL with GET variables at the end. eg http://example.com/dir/link.php?id=123&no=abc

Any help would be appreciated,

Chris

dreamcatcher

8:01 am on Apr 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you looked into the parse_url() [uk2.php.net] function?