Jump to content

find URL in code


fer0an

Recommended Posts

hello

I've some code and I want find and cut url from it using php.

this url link between 1 - 5 link. this mean some times 1 URL in the code sometimes 2 url in the code and ...

can anyone help me?

 

 

MB</div><br/>
<br/>
<br/>
<b><br/>
DOWNLOAD<br/>
<br/>
<a href="http://uploading.com/files/c2182562/LIBERO%252B24%252BLUGLIO%252B2010.pdf/" target="_blank" rel="nofollow">http://uploading.com/files/c2182562/LIBERO%2B24%2BLUGLIO%2B2010.pdf/</a><br/>
<br/>
<br/>
<br/>
<br/>

<a href="http://rapidshare.com/files/408736098/LIBERO_24_LUGLIO_2010.pdf.html" target="_blank" rel="nofollow">http://rapidshare.com/files/408736098/LIBERO_24_LUGLIO_2010.pdf.html</a></b>
</div>
<table class='file-express' width='100%'>
<tr>
<td style='text-align: left; color: #B2AC94; font-size: 3'><br>titletm= LIBERO 24 LUGLIO 2010 LIBERO 24 LUGLIO 2010 :found<br><font color="blue">2</font>http://www.avaxhome.ws/magazines/everyday_practical_electronics_vol_33_no_5_2004.html<br>File exists.dllink'MB</div><br/>
<br/>
<br/>

Link to comment
Share on other sites

Dude,

 

Its a HTML code. So you need to parse it.

 

Refer http://simplehtmldom.sourceforge.net/ . You will see a section called "Quick start".

 

$html = "<put your HTML codes here>";

 

// Find all links

foreach($html->find('a') as $element)

      echo $element->href . '<br>';

 

this will return all <a>'s href...........

 

Hope this will help you..............

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.