PHP Back-Reference Parenthesized Substrings – String Function

<?
$url = "Java2s (http://www.w3mentor.com)";
$url = ereg_replace("http://(([A�Za�z0�9.\-])*)", "<a href=\"\\0\">\\0</a>",$url);
print $url;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.