ereg_replace-2 : ereg_replace « String « PHP






ereg_replace-2

 
<?php

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








Related examples in the same category

1.back-reference parenthesized substrings
2.ereg_replace
3.ereg_replace() function searches for string and replaces pattern if found.
4.ereg_replace.php
5.Using ereg_replace