Hmm. I forgot so I'll ask it here.
How do I fetch everything between 2 tags?
Say I have a variable with [title]titlehere[/title][body]body here[/body] in it
How do I fetch only everything between the title tags?
thanks
| SitePoint Sponsor |
Hmm. I forgot so I'll ask it here.
How do I fetch everything between 2 tags?
Say I have a variable with [title]titlehere[/title][body]body here[/body] in it
How do I fetch only everything between the title tags?
thanks





I think this reg. exp is good enough:
$pat="\[tag\](.*)\[/tag\]";
ereg($pat,$input,$match);
everything between is stored in: $match[1]
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
ok
i think i understand
but what is the input var?





It should be the whole string like:
$input = "fdsfjkhds[tag]wo s348723 word[/tag]djfkhsfjds";
- Son Nguyen
AdSpeed.com - Ad Serving and Ad Management Made Easy
Ok thanks
Bookmarks