Jump to content

[SOLVED] Easy preg_match_all question ... I must need sleep.


phoenixx

Recommended Posts

I've done this a hundred times so not sure why it's not working now....

Here's an example of the line in another website I'm targeting:

<span class="bull1">• </span><a class="menu-sub-level" title="Dark Chocolate" href="http://www.furniturexo.com/advanced_search_result.php?keywords=&categories_id=&inc_subcat=1&manufacturers_id=32&group_id=&type_id=&style_id=&collection=Dark+Chocolate&pfrom=&dfrom=&dto=&x=0&y=0">Dark Chocolate</a>

 

I only Need to extract the actual URL and Text between the anchor... In this case Dark Chocolate 

 

Here's the code I'm using.

 

$data = @file_get_contents("http://www.0000000.com/XXXXXXX.html");  ;

preg_match_all('/y=0".*?><"([^"]*)".*?a>"([^"]*)"/is',$data,$out);

$d = array_combine($out[1], $out[2]);

foreach($d as $k=>$v){

echo $v . "<br>";

}

 

 

Thanks in advance for the help.  I must need sleep... It's been a long 2 day session.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.