What php function can do this?

Discussion in 'PHP' started by dotson83, May 25, 2007.

  1. #1
    I need to read all text between <EDIT>and</EDIT>tags into a varable. How can I do this? It's a html page by the way. I have looked all over the net and haven't come up with much. Thanks for you help.
     
    dotson83, May 25, 2007 IP
  2. Paris Holley

    Paris Holley Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    preg_metch_all will help you out
     
    Paris Holley, May 25, 2007 IP
  3. illusion

    illusion Peon

    Messages:
    427
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    <?php
    $string = EDIT_TAGS_HERE;
    preg_match('/<EDIT>(.*?)<\/EDIT>/', $string, $matches);
    print_r($matches);
    ?>
    PHP:
     
    illusion, May 25, 2007 IP
  4. dotson83

    dotson83 Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    That's what I need. Thanks so much.
     
    dotson83, May 25, 2007 IP
  5. Paris Holley

    Paris Holley Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    if you plan on having more than one set of edit tags be sure to use preg_match_all instead of preg_match
     
    Paris Holley, May 25, 2007 IP