PHP Ereg_Replace.Php – String Function

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

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.