How do I return specific keys from the $_POST array?

Posted by Brook on Stack Overflow See other posts from Stack Overflow or by Brook
Published on 2010-06-07T20:10:39Z Indexed on 2010/06/07 20:22 UTC
Read the original article Hit count: 258

Filed under:
|
|
|

I would like to check to see if there are any keys in $_POST that contain a string. The string will not be the full key, only part of the key. (ie. search string = "delRowID", $_POST key = "delRowID_16"). I have tried to use array_keys($_POST,"delRowID"), but it has never returned anything.

CODE

print_r($_POST);
print_r(array_keys($_POST,"delRowID"));

RETURNS

Array ( [delRowID] => 29 [qAction] => [elmUpdateId] => [elmTtl] => [elmDesc] => [elmStr] => ) Array ( )

© Stack Overflow or respective owner

Related posts about php

Related posts about post