Jump to content

how to post in an array and then read it?


jwr38

Recommended Posts

Hi,

 

I am creating a script where I would like to post information into an array to use.

 

for example,

 

my array as it currently stands.

$players = array(									//player type
0 => array(
		array(10,99,40,41,25,26,70,80),//CK
		array(3,4,40,50,25,46,70,80),//FG
		array(5,6,40,50,25,46,70,80),//DI
		array(80,90,60,70,40,50,20,30),//SK
		array(9,10,40,50,25,46,70,80),//ST
		array(1,10,40,50,25,46,70,80),//EN
		array(1,10,40,50,25,46,70,80),//DU
		array(1,10,40,50,25,46,70,80),//PH
		array(1,10,40,50,25,46,70,80),//FO
		array(1,10,40,50,25,46,70,80),//PA
		array(80,90,80,90,80,90,80,90),//SC
		array(1,10,40,50,25,46,70,80),//DF
		array(1,10,40,50,25,46,70,80),//PS
		array(1,10,40,50,25,46,70,80),//EX
		array(80,90,80,90,80,90,80,90),//LD
		array(1,10,40,50,25,46,70,80)//PO
			),
1 => array(
		array(10,90,40,41,25,26,70,80),
		array(3,4,40,50,25,46,70,80),//FG
		array(5,6,40,50,25,46,70,80),//DI
		array(80,90,80,90,80,90,80,90),//SK
		array(9,10,40,50,25,46,70,80),//ST
		array(1,10,40,50,25,46,70,80),//EN
		array(1,10,40,50,25,46,70,80),//DU
		array(80,90,80,90,80,90,80,90),//PH
		array(1,10,40,50,25,46,70,80),//FO
		array(80,90,80,90,80,90,80,90),//PA
		array(1,10,40,50,25,46,70,80),//SC
		array(1,10,40,50,25,46,70,80),//DF
		array(1,10,40,50,25,46,70,80),//PS
		array(1,10,40,50,25,46,70,80),//EX
		array(80,90,40,50,25,46,70,80),//LD
		array(1,10,40,50,25,46,70,80)//PO
			));

 

I would like to be able to post into each block where there is numbers. I later access the numbers in the array. Right now can access my array by putting $mynumber=$players[0][3][5]; echo $mynumber;

 

I know I have to change how I call in the array but I am unsure how t go about it. Can anyone help me out?

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.