- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$text = "http://www.google.com/\\r\\nhttp://www.google.com/\\r\\nhttp://www.google.com/";
preg_match_all("/(http|ftp)+(s)?:(\/\/)((\w|\.|\-)+)(\/)?(\S)+/",$text,$matches);
print_r($matches[0]);