Results 1 to 3 of 3

Thread: Simple thing in PHP

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    89

    Simple thing in PHP

    Hey thanks for reading this


    I want to extract data between two strings from source code of page.So like;


    <b>Nanana: </b>Data<br>


    So it should extract just Data from this string.I bet it can be done using RegEx but I am having huge problems with it so if anyone could share working example how could i do it.


    Thx

  2. #2

    Thread Starter
    Lively Member
    Join Date
    May 2008
    Posts
    89

    Re: Simple thing in PHP

    Okay figured it out myself


    function lol($start, $end, $str)
    {
    $split1 = explode($start, $str);
    $out = str_replace($end, '', $split1[1]);
    }

    If anyone figures is out how to do with regex please let me know

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171

    Re: Simple thing in PHP

    The regular expression would be something like this:

    #</b>(.+)<br>#


    Has someone helped you? Then you can Rate their helpful post.

Posting Permissions

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



Click Here to Expand Forum to Full Width