Re: http_build_query ... argh

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

 



Arpad Ray wrote:
> Jochem Maas wrote:
>> function inputPostQueryUnBorker($s)
>> {
>>         return preg_replace('#(\?|&(?:amp;)?)([^=]*)=#eU',
>>                             "'\\1'.str_replace(array('%5B','%5D'),
>> array('[',']'), '\\2').'='",
>>                             $s);
>> }
>>
>> so how bad is it
> This is a bit more concise. I doubt there'd be a noticable difference in
> speed though:
> 
> return preg_replace('#%5[bd](?=[^&]*=)#ei', 'urldecode("\0")', $s);

nice! - although I had to test your regexp, I can't figure out
exactly what it's doing but it seems to work exactly like mine...

could you explain your regexp - I'd like to replace my version with
your (if for no other reason than that shorter code is easier to read than
longer code!) BUT until I really understand your regexp I'd feel 100% comfortable
making the replacement.

kinds regards,
Jochem

ps - sometimes reading regexps is a lot harder than writing them!

> 
> Arpad

-- 
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