Skip to content
WJunction - Webmaster Forum

preg_match help need!

Status
Not open for further replies.

saninokia

Experienced Member
929
2010
71
i am trying to make filepost download system using curl,how to search the value using preg_match? please help.


PHP:
<div class="dbutton"><a class="premium_but" href="#" onclick="download_file('http://fs102.filepost.com/get_file/%3D%3DgZ9A5Q8%7Cckt9eJfXpE7NviWoeJhxWBDm1iSMSD4Wt8Jk5NOlgjASCKFMbKFHkgo3j3exCapmEj7RCH9lgY1a8tospmLKdWAE40rH5c-qVVgDKTr0-hzEiYcwVDZj2lxXhTadqcwpX5eDvntpGkTMeZQnARaVwTlld8Yn-cozevRzKEADWCFsYnaCZcX1FRUu9riSZEE7Z0iCtiI%7C7nnb9QrDpNjfjXUEUT5YbNfIVfLiXxzrFZn3C4HBJcqnBQCutp3ZMwcZ7ghEMCtSzFrCGTMd-Ne73Jru0Km6RCGDa8qiHD2wad98L-HtnaM-JHXU0fRfuLDAMUE6nwmu2RmzuoqEcdz6mKnF0turLgFJdQnJzgGyk2Ufu2Au5zfcD4GUyHv7%7CWBKIe%7CuGO1Gd4hy-z/'); return false;"><span>download</span></a></div>
 

8 comments

Code:
preg_match('/<div class="dbutton"><a class="premium_but" href="#" onclick="download_file\(\'(.*?)\'\);/',$code, $match);
echo $match[1]; //download link

You don't make much 'sense'. What 'value' are you trying to retrieve?

he already said he is trying to download the file so ofc. he needs downloading link :|
 
Please, please, please use hashes or vertical bars in your regex guys, not forward slashes.

You're far less likely to ever need to type a hash than you are to type a forward slash, so much less escaping is needed.
 
Status
Not open for further replies.

About the author

S
Experienced Member · Joined
.::. Affordable & Reliable IT Services .::.
929
Messages
71
Reactions
28
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom