User Profile

Collapse

Profile Sidebar

Collapse
LaurentPerche
LaurentPerche
Last Activity: Apr 12 '12, 03:30 AM
Joined: Apr 11 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • 1) There is no Backslash in the regular expression but i guess you are referring to slash / so I changed it to \/
    2) # is like / works the same afaik. I changed it back to \ anyway
    3) I think I got it working now. thanks.
    Code:
    <?php
    $str = file_get_contents("http://www.infosniper.net/index.php?ip_address=203.84.219.114");
    $regexp = "/<strong>(.*)<\/strong>/";
    preg_match_all($regexp,
    ...
    See more | Go to post

    Leave a comment:


  • LaurentPerche
    started a topic preg_match_all to retrieve data from HTML page
    in PHP

    preg_match_all to retrieve data from HTML page

    I am a beginner so bare with me please.

    I am trying to create a PHP script to retrieve the location of an IP address using the info sniper.net webpage.

    I am trying to parse the following HTML code:
    Code:
    map.openInfoWindow(map.getCenter(),"<br /><strong>n/a, Hong Kong</strong>");
    and thought that the following PHP script would work:
    Code:
    <?php
    $str = file_get_contents("http://www.infosniper.net/index.php?ip_address=203.84.219.114");
    ...
    See more | Go to post
    Last edited by LaurentPerche; Apr 11 '12, 11:20 AM. Reason: couldn't get the [CODE] tag to work
No activity results to display
Show More
Working...