Jump to content

preg_match_all


Cyto

Recommended Posts

Hi,

 

Can someone check wye this gives a empty array:

$url = "http://www.someurl.com";
$file = file_get_contents($url);
$preg = '<a href='."'(.*)'".'><span class=window2 style="text-transform: capitalize">(.*)<\/span><br \/> [(.*)]<\/a>';
preg_match_all('/'.$preg.'/i', $file, $m); //name

print_r($m);

 

Output:

Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) ) 

 

I am trying to find a name link in a,span from another site, but gives me a empty array. Can someone help?

 

thanks, Cyto

Link to comment
https://forums.phpfreaks.com/topic/251893-preg_match_all/
Share on other sites

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.