Re: $_post and array question

From: Date: Mon, 17 May 2004 22:15:03 +0000
Subject: Re: $_post and array question
Groups: php.general 
Request: Send a blank email to php-general+get-186441@lists.php.net to get a copy of this message
[snip] functionX($_POST["test_arr"]) $arr_test = $_POST["test_arr"]; Knowing that $_POST["test_arr"]) does not exist.. this code will not result in a error. Is this a bug,error,etc? Should this not also produce a novice error? [snip] I think when you are doing this functionX($_POST["test_arr"]) $arr_test = $_POST["test_arr"]; $_POST["test_arr"] is a local variable to the functionX, not the $_POST superglobal. (I might be wrong) try to define you function like this: functionX($testArr) $arr_test = $testArr; and call it like this: $test = functionX($_POST["test_arr"]); //you will probably get your undefined index warning here

« previous php.general (#186441) next »