Re: Matching
| From: | Eric Butera | Date: | Sat, 31 Jan 2009 13:38:56 +0000 |
| Subject: | Re: Matching | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-287480@lists.php.net to get a copy of this message | ||
On Sat, Jan 31, 2009 at 7:32 AM, Ashley Sheridan
<ash@ashleysheridan.co.uk> wrote:
> On Fri, 2009-01-30 at 21:33 -0500, Eric Butera wrote:
>> On Fri, Jan 30, 2009 at 9:28 PM, Ron Piggott <ron.php@actsministries.org> wrote:
>> > How do I determine the value of tx from this string?
>> >
>> >
>> > page/words_from_the_well_checkout/?tx=8UM53005HH344951T&st=Completed&amt=0.01
>> >
>> > My desired answer is: 8UM53005HH344951T
>> >
>> > I am trying to capture the serial number which follows tx= and ends
>> > immediately before the &
>> >
>> > Ron
>> >
>>
>> http://us.php.net/parse_str
>>
>> --
>> http://www.voom.me | EFnet: #voom
>>
> Go regular expressions...
>
> /tx=([^\&]+)/
>
> then do a preg_match with the string using the $matches array argument.
> $matches[1] should be your value.
>
>
> Ash
> www.ashleysheridan.co.uk
>
>
There really isn't a need to even try to build something like that
when something already exists exactly for the purpose. It's well
documented too. Plus after this part works, there's probably a good
chance we'd be looking for that second variable. =)
--
http://www.voom.me | EFnet: #voom