SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    preg_match between?

    HTML Code:
    IP Test</span> Date: <b>6/1/2011</b> &#xa0;&#xa0;&#xa0; Pool: <b>BAKKEN</b> &#xa0;&#xa0;&#xa0; IP Oil: <b>1474</b> &#xa0;&#xa0;&#xa0; IP MCF: <b>961</b> &#xa0;&#xa0;&#xa0; IP Water: <b>2176</b><br>
    Cores and Samples
    Anyone help with the syntax to get the information between "IP Test</span> Date: <b>" and "IP Water:"?

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    end(explode("IP Test:</span> Date: <b>",reset(explode('IP Water:',$string))));
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  3. #3
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    PHP Code:
    $bits explode'&#xa0;&#xa0;&#xa0;'strip_tags($txt));

    echo 
    $bits[1];
    echo 
    $bits[2];
    echo 
    $bits[3];

    // gives you access to the pieces:

    PoolBAKKEN 
    IP Oil
    1474 
    IP MCF
    961 
    Close enough?

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice Lion! Cups, that would work too although I didn't say it's exploding from a string that has a bunch of those delimiters before and after.

    Thanks for the insight gentlemen!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •