Re: Matching

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 31, 2009 at 7:32 AM, Ashley Sheridan
<ash@xxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx> 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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux