Jump to content

Help with a multi-level array


smerny

Recommended Posts

What am I missing here?

 

The array:

	protected $form_bonus = array(
	"Attacker" => array(
		"Ashwin" => array(
			"normal" => 1.15,
			"rps" => 1.38), 
		"Cordelon" => array(
			"normal" => 1.15,
			"rps" => 1.38),
		"Mersan" => array(
			"normal" => 1.15,
			"rps" => 1.38),
		"Phlanixian" => array( 
			"normal" => 1.195,
			"rps" => 1.494),
		"Slythe" => array(
			"normal" => 1.15,
			"rps" => 1.38)
	),
	"Defender" => array(
		"Ashwin" => array(
			"normal" => 1.15,
			"rps" => 1.38), 
		"Cordelon" => array(
			"normal" => 1.15,
			"rps" => 1.38),
		"Mersan" => array(
			"normal" => 1.15,
			"rps" => 1.38),
		"Phlanixian" => array(
			"normal" => 1.15,
			"rps" => 1.38),
		"Slythe" => array(
			"normal" => 1.15,
			"rps" => 1.38)
	)
);

 

accessing it:

$bonus *= form_bonus[$this->role][$this->race]['rps'];

 

error:

PHP Parse error:  syntax error, unexpected '['

Link to comment
https://forums.phpfreaks.com/topic/258290-help-with-a-multi-level-array/
Share on other sites

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.