raffinare Posted July 31, 2010 Share Posted July 31, 2010 i'm trying to grab the file name from mediafire to my database caption, I have rapidshare working fine. here's the code for rapidshare if($type==1) { $words=$links[$j]; preg_match("/rapidshare\.com\/files\/\d+\/(.+)/",$words,$match); unset($words); $words=$match[1]; unset($match); $words=preg_split("/[_\.\-]/",$words); $lastword=array_pop($words); if($lastword=="html") array_pop($words); $words=implode(" ",$words); $words=preg_replace("/\s{2,}/"," ",$words); $caption=mysql_real_escape_string($words); unset($words); } How ever, i'm not sure which preg_match would be the correct one for mediafire.. appreciate any help. Link to comment https://forums.phpfreaks.com/topic/209468-help-with-preg_match/ Share on other sites More sharing options...
raffinare Posted July 31, 2010 Author Share Posted July 31, 2010 anyone? :-\ Link to comment https://forums.phpfreaks.com/topic/209468-help-with-preg_match/#findComment-1093722 Share on other sites More sharing options...
magnetica Posted July 31, 2010 Share Posted July 31, 2010 Goto mediafire and download a file look at the link and construct a regex expression according to their url for downloading files Link to comment https://forums.phpfreaks.com/topic/209468-help-with-preg_match/#findComment-1093729 Share on other sites More sharing options...
raffinare Posted July 31, 2010 Author Share Posted July 31, 2010 Goto mediafire and download a file look at the link and construct a regex expression according to their url for downloading files Thanks for your help, I am a noob on php, started to learn a while back, the mediafire link is like this http://www.mediafire.com/?mneyk0ppcej and i'm not familiar on how to construct a regex expression according to their url, can you give some tips? thanks Link to comment https://forums.phpfreaks.com/topic/209468-help-with-preg_match/#findComment-1093730 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.