radi8 Posted July 21, 2010 Share Posted July 21, 2010 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" Link to comment https://forums.phpfreaks.com/topic/208408-accessing-elements-in-embedded-_post-array/ Share on other sites More sharing options...
KevinM1 Posted July 21, 2010 Share Posted July 21, 2010 $_POST['matType'] is itself an array. So just use the proper key: $_POST['matType'][6] Link to comment https://forums.phpfreaks.com/topic/208408-accessing-elements-in-embedded-_post-array/#findComment-1089049 Share on other sites More sharing options...
radi8 Posted July 21, 2010 Author Share Posted July 21, 2010 DOH... You know sometimes everyone has brain farts. Thanks for the help. I have no idea way this threw me the way it did. Link to comment https://forums.phpfreaks.com/topic/208408-accessing-elements-in-embedded-_post-array/#findComment-1089055 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.