try this

PHP Code: 
<?
if(isset($_POST['links'])) {
$links=$_POST['links'];
$lll=array();
$pattern '/http[^ ["<\t\n\r\f]{1,}/';
preg_match_all($pattern$links$matches);
for(
$i 0$i count($matches[0]); $i++)
{
    
$link $matches[0][$i];
    if(
stristr($link,'wupload')) $lll['Wupload'][]=$link;
    elseif(
stristr($link,'filesonic')) $lll['Filesonic'][]=$link;
    elseif(
stristr($link,'fileserve')) $lll['Fileserve'][]=$link;
    elseif(
stristr($link,'rapidshare')) $lll['Rapidshare'][]=$link;
    elseif(
stristr($link,'megaupload')) $lll['Megaupload'][]=$link;
}

foreach(
$lll as $host=>$ll) {
    
$i=1;
    echo 
$host.': ';
    foreach(
$ll as $l) { echo '<a href="'.$l.'">Link #'.$i.'</a> '$i++; }    
    echo 
'<br />';
}

}
else {
echo 
'<form method="post"><textarea name="links"></textarea><input type="submit" /></form>';    
}
this is what you get: