3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cleaner($url) { $U = explode(' ',$url); $W =array(); foreach ($U as $k => $u) { if (stristr($u,'http') || (count(explode('.',$u)) > 1)) { unset($U[$k]); return cleaner( implode(' ',$U)); } } return implode(' ',$U); } $url = "Here is another funny site www.tinyurl.com/55555 and http://www.tinyurl.com/55555 and img.hostingsite.com/badpic.jpg"; echo "Cleaned: " . cleaner($url);

preferences:
39.63 ms | 402 KiB | 5 Q