Since you cannot predict the length of the string, the way I usually solve this kind o 
f thing is by reading the damn thing BACKWARDS.
As soon as I get a slash, voilá ...

----- Original Message ----- 
From: "Herhuth, Ron" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 06, 2003 2:51 PM
Subject: [PHP-WIN] Extract Path from URL



I'm having a tough time getting my head around regular expressions.  Could somebody 
show me how to extract the path (minus the file name) from this URL:

http://www.test.com/path1/thisdoc.html

I would like to extract this:
http://www.test.com/path1/


Thanks in advance,
Ron




-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to