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