PHP Ereg_Replace-2 – String Function

<?php$url = "Java2s (http://www.w3mentor.com)";
$url = ereg_replace("http://([a-zA-Z0-9./-]+)([a-zA-Z/]+)", "<a href=\"\\0\">\\0</a>", $url);
print $url;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.