Author Topic: help with preg_match  (Read 433 times)

0 Members and 1 Guest are viewing this topic.

Offline raffinareTopic starter

  • Irregular
  • Posts: 4
    • View Profile
help with preg_match
« on: July 31, 2010, 05:57:41 PM »

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
Code: [Select]
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.

Offline raffinareTopic starter

  • Irregular
  • Posts: 4
    • View Profile
Re: help with preg_match
« Reply #1 on: July 31, 2010, 06:41:09 PM »
anyone?  :-\

Offline magnetica

  • Enthusiast
  • Posts: 206
    • View Profile
Re: help with preg_match
« Reply #2 on: July 31, 2010, 07:32:09 PM »
Goto mediafire and download a file look at the link and construct a regex expression according to their url for downloading files
Free work to boost Portfolio - PM me

Offline raffinareTopic starter

  • Irregular
  • Posts: 4
    • View Profile
Re: help with preg_match
« Reply #3 on: July 31, 2010, 07:44:27 PM »
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
Code: [Select]
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
« Last Edit: July 31, 2010, 07:46:12 PM by raffinare »