Results 1 to 5 of 5

Thread: preg_match_all [*resolved*]

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    preg_match_all [*resolved*]

    PHP Code:
    preg_match_all('/{loop='.$LoopName.'}^(.*?){\/loop=}/'$this->data,$matches
    ok i am trying to get it to work over multilines and it works if i only have one set of "{loop=name}.....other stuff......{/loop}" tags. When i have two or more it ignores the next "{/loop}" and goes straight to the last tag? does anyone know how i can solve this problem.


    Thanks
    Last edited by john tindell; Aug 28th, 2003 at 03:45 PM.

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    why do you have 2 loop= in there if you only want {loop=} and {/loop}

  3. #3

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    thats just where i miss typed it from my code, hmm should copy n paste more.

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    well then if you have the wrong code how can we help?

  5. #5

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    PHP Code:
    preg_match_all('/{loop='.$LoopName.'}(.*?){\/loop}/sim'$this->data,$matches
    thats what i was looking for, thank every one

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