Jump to content

Problem with var_dump and array


g_p_java

Recommended Posts

Hi i would like to insert some values in the same array and i do:

 


$arr_codes = array("0" => 'j');
$arr_codes = array("1" => 'a');
$arr_codes = array("2" => 'b');
$arr_codes = array("3" => 'c');
$arr_codes = array("4" => 'd');
$arr_codes = array("5" => 'e');
$arr_codes = array("6" => 'f');
$arr_codes = array("7" => 'g');
$arr_codes = array("8" => 'h');
$arr_codes = array("9" => 'i');

var_dump($arr_codes);

 

The output i get is :

 

array(1) { [9]=>  string(1) "i" } count : , 0

 

it seems that every time i overwrite:

 

what i have written before!!!

 

What shall i correct in that? I guess, i shall use a for loop and "playing with indexes".

 

like for ($i = 0; etc);

 

May you please help me?

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/143624-problem-with-var_dump-and-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.