Re: Re[2]: Comparing string to array

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

 



On 19/06/07, Richard Davey <rich@xxxxxxxxxxxxx> wrote:
Hi Robin,

Tuesday, June 19, 2007, 8:28:50 PM, you wrote:

> On 19/06/07, Richard Davey <rich@xxxxxxxxxxxxx> wrote:
>>     $userparam = "test['sam'][]";
>>
>>     //  How to check if $userparam exists in the $_POST array
>>     //  and get all the values from it?

> full_key_exists("test['sam'][]", $_POST) // returns true if key is set

> full_find_key("test['sam'][]", $_POST) // returns value of key or undef.

> function full_key_exists ($key, $array) {
>   preg_match_all('/[^][]+/', $key, $branch);

>   if (!sizeof($branch[0])) false;

This should of course have a 'return' before the 'false'.

I should really test things before I post.

-robin

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