SagarPPanchal
SagarPPanchal

Reputation: 10111

array giving weird result made from HTML

html :

<input type="text" name="ps[part1['test']]" value="testing multiple array">

Current result :

[ps] => Array
    (
        [part1['test'] => testing multiple array 
    )

Expecting result :

[ps] => Array
    (
        [part1] => Array
            (
                [test] => 12:00
            )

    )

Last quote is being break somewhere

is there anything missing ?

Upvotes: 0

Views: 40

Answers (1)

Dekel
Dekel

Reputation: 62556

You should use ps['part1']['test'] as the name of the input:

<input type="text" name="ps['part1']['test']" value="testing multiple array">

This way - when you POST the data to PHP it will get into the $_POST['ps'], create an array with the key part1, and then create another key with the name test inside $_POST['ps']['part1'].

Upvotes: 3

Related Questions