- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$pattern = "/(\w|\.|\-)+:\/\/(\w|\.|\-)+(\/[^\s]*)?/";
$subject = "z39.50r://8.1.6.8/test.php?alkj
view-source://test-v.com/test^alk
soap.beep://testing21/351ads
fftp://";
preg_match_all($pattern, $subject, $matches);
echo "<pre>" . print_r($matches) . "</pre>";