View Single Post
Old 01-14-2009, 04:54 PM  
RayVega
Confirmed User
 
RayVega's Avatar
 
Industry Role:
Join Date: Jul 2004
Location: New York ICQ#348007554
Posts: 4,212
PHP Help? Gurus, hook a brother up...

Been a while since I wrote code and I'm working on a small script and sadly I'm stuck on what should be a relatively easy regular expression match in PHP.

I have a variable with a bunch of text and need to match the text between two different patterns and assign it to a variable.

Ex.
$a="...$agentid=1010303&listingid...etc.";

I need to grab text between $agentid= and &listingid and assign to variable so I am left with $num="1010303". Now, I have to do some things with that number but first need to extract it from the variable.

Rather than sift through web pages and using trial and error, I figure one of you guys can spew it out off the top of your head.

Any ideas?
__________________
Ray "The Don" Vega

Managing Director
Private Equity Fund

[email protected]
RayVega is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote