array indexes as arguments to a function
| From: | Dennis Gearon | Date: | Mon, 12 Jul 2004 21:47:37 +0000 |
| Subject: | array indexes as arguments to a function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-190299@lists.php.net to get a copy of this message | ||
please CC me, as I am on digest.
-------------------------------------------------------------------
say I've got a class that stores the cookie/get/post vars.
I want to retrieve say one of them.
Say, that post vars come back from browser as:
POST["var1_arr"]["dim1"]["dim2"]
they are stored in
object->post_vars["var1_arr"]["dim1"]["dim2"];
object->post_vars["singleton"];
I have the function
class->get_post_var($index_arr){
return correct, processed post var;} How can I get the function to return an arbitrary depth into the post vars array? i.e. EITHER return $this->class_user_input_processing_function( $this->post_vars, $index_arr); Where $index_arr contains either: $index_arr = array("var1_arr","dim1_value", "dim2_value"); -or- $index_arr = array("singleton");