Assuming you want to pull links out of plain text (Your question wasn't overly specific):
if (preg_match_all("/(((https?|ftp|gopher):\/\/|(mailto|file|news):)[^' <>\"]+|(www|web|w3).[-a-z0-9.]+)[^' .,;<>\":]/i",$text,$matches))
$links=$matches[0];
The links from $text will be in the $links array