I am almost embarrassed to put this up but I am perplexed and I am on a deadline. Probably a simple typo that I can't see.
I have these three lines of code: ($p is part of a POST array)
echo "<pre>";
print_r($p);
echo "Foo:".$p['fn2'];
And the output is this.
Array
(
['fn1'] => uobQEC8IGQcd
['fn2'] => P1ZVSXBJzloE
)
Foo:
Why doesn't $p['fn2'] print? This is driving me nuts. I shortened this for the example but there are many more FNs in there too and none will display individually, yet I can see them when I dump the array. Arrrgh!
UPDATE: on suggestion, a little more code... this is inside a foreach loop that starts:
foreach ($_POST['pairs'] as $key=>$p) {
UPDATE 2:
VARDUMP:
array(10) {
["'fn1'"]=> string(12) "uobQEC8IGQcd"
["'fn2'"]=> string(12) "P1ZVSXBJzloE"
["'state1'"]=> string(6) "active"
["'state2'"]=> string(6) "active"
["'crit1'"]=> string(2) "27"
["'crit2'"]=> string(2) "24"
["'warn1'"]=> string(2) "18"
["'warn2'"]=> string(2) "12"
["'owner2'"]=> string(5) "Adobe"
["'name2'"]=> string(5) "Rack1"
}
UPDATE 3: I am setting up the post variable arrays like this (in js)
$('<input>').attr({ type: 'hidden', name: "pairs["+fn1+"]['fn1']", value:fn1 }).appendTo('form');
$('<input>').attr({ type: 'hidden', name: "pairs["+fn1+"]['fn2']", value:fn2 }).appendTo('form');