string between strings

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

string between strings

Post by itsmani1 »

Hi
i want to get string between "<contact:id>" and "</contact:id>"
the value between both strings is changeable is there any function that can help me in finding this value or if any regular expression?


string:
<contact:id>Olnic502585</contact:id>


thanks
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

This type of regex has been talked about endlessly in the regex board, please look there.
Post Reply