Scarass Scarass - 1 year ago 84
PHP Question

Pass input data to subarray of GET or POST

Is it possible to have some data in a sub array of


Say I want input values from user in
, instead of
Or in post?

Answer Source

Yes, it's possible.

Instead of:

<input type="text" name="input_value" />

You can use:

<input type="text" name="inputs['input_value']" />

This way - php gets the inputs as an Array and the inputs_value is one of the keys in that array:


You can use the var_dump function to dump the $_GET and $_POST arrays to see their values:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download