views:

41

answers:

1

Hi,

Inside my webpage "http://www.my_web_page" I have something like that: img border="0" class="borderx" id="pic_15132"

I wanna know which parameter did I have to use inside preg_match_all("") to retrive only the number. Here is what I tried but my result is: _15132

$webpage = file_get_contents("http://www.my_web_page");

   preg_match_all("#_([^>]*)[0-9]{6}#", $webpage , $matches)
        foreach($matches[0] as $value) 
         { 
                echo $value . "<br>"; 
            }

Thanks,

+1  A: 
$webpage = file_get_contents("http://www.my_web_page");

preg_match_all("#_[^>]*([0-9]{6})#", $webpage , $matches)
   foreach($matches[1] as $value) 
      { 
          echo $value . "<br>"; 
      }
roddik
soo fast and perfect. Thank you~
ludo
@ludo: then please accept his answer (click the checkmark next to this answer). This will get both you and him some extra reputation, and shows your appreciation.
Stephan202
@ludo: also, it'd be nice to upvote roddik's answer.
Stephan202
ha sorry I didn't know that thx~
ludo