lol ok let me explain it from a coder's pov.
I have this multidimensional array:
$array = array(
array("4" => 'poison'),
array("4" => 'tackle'),
array("6" => 'sleep powder'),
array("44" => 'giga drain'),
array("32" => 'synthesis'),
array("23" => 'growth'),
array("1" => 'double edge'),
array("5" => 'take down')
);
It is for a game, and it is in the format array("level_number" => "attack_name")
You learn new attacks based on the level you are at, if i just moved up to level 4, i want to get a code that gets the new attacks i will learn from this multidimensional array like so:
foreach($array as $a){
$attacks[] = $a['4'];
}
print_r($attacks);
and the output is:
Array
(
[0] => poison
[1] => tackle
[2] =>
[3] =>
[4] =>
[5] =>
[6] =>
[7] =>
)
This code is bad because it has empty fields and I am not comfortable with the way it is made. I want to know if there is a prettier way to to code this.