<?php
function rs_check($url){
    if (!
$url) return false;
    
$files_pattern'/\/files\/([^\/]*)\//';
    
$filename_pattern'/\/files\/.*\/(.*)/';
    
preg_match($files_pattern$url$matches_id);
    
preg_match($filename_pattern$url$matches_name);
    
$resfile_get_contents("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles_v1&files={$matches_id[1]}&filenames={$matches_name[1]}");
    list(
$fId,$fName,$fSize,$fServerId,$fStatus,$fShortHost,$fmd5) =explode(',',$res);
    return (
$fStatus==|| $fStatus==2);
}
?>