Trying to extract text between strings in txt file

Discussion in 'PHP' started by IamNed, Oct 30, 2011.

  1. #1
    I have spent over an hour trying to get this to work
    I want to extract the

    values between ":"

    and ","eng_data&

    the result will be a long list of IDs like this:

    40027521936
    .
    .
    .


    here is the file
    http://fdguirhgeruih.x10.mx/html.txt


    Nothing is working..need help
     
    IamNed, Oct 30, 2011 IP
  2. dazst

    dazst Active Member

    Messages:
    115
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    78
    #2
    <?php
    $data   = file_get_contents("http://fdguirhgeruih.x10.mx/html.txt");
    preg_match_all("|&quot;:&quot;([0-9]+)&quot;,&quot;eng_data&|s",$data,$preg_d);
    print_r($preg_d);
    ?>
    Code (markup):
     
    dazst, Oct 30, 2011 IP