Jump to content

help with preg_match


raffinare

Recommended Posts

 

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.