Jump to content

Accessing elements in embedded _POST array


radi8

Recommended Posts

Ok, I am very rusty at my PHP and this should be a simple question.

 

I have a page that will post the following arrays:

--> Form data (POST) <-- 
Array
(
    [matType] => Array
        (
            [0] => Repro:MultiColor
            [1] => Repro:Natural
            [2] => Repro:HMW
            [3] => Regrind:Natural
            [4] => Regrind:MultiColor
            [5] => Regrind:HMW
            [6] => Regrind:Inj. Crate
            [7] => Regrind:Inj LD
        )

    [LOW_MI] => Array
        (
            [0] => 0.16
            [1] => 0.45
            [2] => 0.025
            [3] => 0.45
            [4] => 0.15
            [5] => 0.25
            [6] => 3
            [7] => 3
        )

    [HIGH_MI] => Array
        (
            [0] => 0.5
            [1] => 0.75
            [2] => 0.1
            [3] => 0.75
            [4] => 0.55
            [5] => 0.1
            [6] => 7
            [7] => 7
        )

    [selectedRow] => 6
    [updateRow] => Update Selected Row
    [action] => submitted
)

I need to be able to access the embedded arrays and get to the selected element in each (element 6 in this case)

 

What is the syntax to get to the array element I need?

i.e.

$selRow= $_POST['SelectedRow']; // returns 6
$materialType = $_POST['matType'] ;//???? I need element from position 6 or "Regrind:Inj. Crate"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.