Page 1 of 1

2D arrays in php.

Posted: Mon Aug 15, 2011 11:48 am
by VZdemon
does any1 know how to make a 2d array in php

Re: 2D arrays in php.

Posted: Mon Aug 15, 2011 11:55 am
by Xaleph

Code: Select all

$array['first'] = array("second" => array(
  "third" => array("
               fourth" => array(
                         "fifth" => array()))
));
Like this? First is a first dimension, second is 2 dimensional, third is 3d dimension, et cetera.

Re: 2D arrays in php.

Posted: Fri Sep 16, 2011 10:12 am
by VZdemon
ty

Re: 2D arrays in php.

Posted: Fri Sep 16, 2011 3:10 pm
by hallsofvallhalla
or if you want to do it the fun way to be different

$be_an_ahole = "first second third fourth fifth";
$my_ahole_array = explode(" ",$be_an_ahole);

echo $my_ahole_array[0];
echo $my_ahole_array[1];

Re: 2D arrays in php.

Posted: Fri Nov 25, 2011 2:25 pm
by VZdemon
loooooooooool :lol: :lol: :lol: