Re: syntax problems
| From: | Steve Edberg | Date: | Sat, 14 Oct 2000 20:58:31 +0000 |
| Subject: | Re: syntax problems | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-20168@lists.php.net to get a copy of this message | ||
At 10:43 PM +0200 10/14/00, n e t b r a i n wrote:
Hi, I'm in trouble with an multidimensional array ... I'm not able to get the right sizeof() of it submitted by a client form ... I mean: from this client form /*html code*/ <input type="text" name="fuseVarMust[var1][t][null]"><br> <input type="text" name="fuseVarMust[var2][t][null]"><br> /*html code*/ when it is submitted, using sizeof($fuseVarMust) returns always 2 even if one of the form values is missed ... So, my question is: How can I take the right number of the array elements submitted? Many thanks in advance maxIn PHP3, you can only use one-dimensional arrays as form variable names. In PHP4, however, I've heard this CAN be done. In your case, a common workaround is to create variables of the form: <input type="text" name="fuseVarMust_var1_t[null]"><br> <input type="text" name="fuseVarMust_var2_t[null]"><br> This makes parsing form vars more work, but it is doable. Or, just upgrade to PHP4! -steve +--- "They've got a cherry pie there, that'll kill ya" ------------------+
| Steve Edberg University of California, Davis | | sbedberg@ucdavis.edu Computer Consultant | | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ |+-------------------------------------- FBI Special Agent Dale Cooper ---+