Peter
Peter

Reputation: 3495

Can't get value from multidimensional array

I've been doing a lot more Python than PHP recently so perhaps I've forgotten something important, but as far as I can see, this looks like it should work. What's actually wrong with it?

$form_settings = array('typeofzone' >= array('tm', 'tp', 'tc'),
                       'chargenum' >= array('pcn'));

$form_id = 'typeofzone';

// This echoes absolutely nothing
echo $form_settings[$form_id][0];
echo $form_settings[$form_id][1];
echo $form_settings[$form_id][2];

Upvotes: 1

Views: 40

Answers (2)

Panda
Panda

Reputation: 46

$form_settings = array('typeofzone' >= array('tm', 'tp', 'tc'),
                       'chargenum' >= array('pcn'));

should be:

$form_settings = array('typeofzone' => array('tm', 'tp', 'tc'),
                       'chargenum' => array('pcn'));

Upvotes: 1

obe
obe

Reputation: 7806

Your syntax is wrong... you should use "=>" instead of ">="...

Upvotes: 2

Related Questions