Posted by:
rip_pit
(---.w82-125.abo.wanadoo.fr)
this is so called "url rewriting" but often used in apache's .htaccess files.
you're It's a kind of url rewriting ...
here's a script to help you :
/* original source @ [www.php.net] ** modified to feet the need. */
$anyurl = "[www.exampledomain.com];;
preg_match ( '@(http://.*[^/])([/].*)@i' , $anyurl , $matches );
print_r($matches); // print all stored results
printf("<p><a href=\"%s\">[%s]</a></p>", $anyurl, $matches[1] ); // print simple link
printf("<p>[<a href='%1\$s' title='%1\$s'>%2\$s</a>]</p>", $anyurl, $matches[1]); //with title
/* Replace the preg_match line with this one to exclude capturing the http:// caracters :
preg_match('@(?:[])(.*[^/])([/].*)@i', $anyurl, $matches);*/
---------------------------------------------
XP SP3 - pIV - 3.2Ghz - 1.5Go de ram - Wamp 2.0
Edited 2 time(s). Last edit at 01/30/2008 07:08PM by rip_pit.