how to use array_push when pushing both key and value in PHP -


i have empty array. able push values using

array_push($list, item[0]); 

but how push both key , value.

array_push($list[$key], $item[0]) 

this not work.

$list['key']=$item[0]; 

should work.

note: if use array_push() add 1 element array it's better use $array[] = because in way there no overhead of calling function.


Comments

Popular posts from this blog

c++ - Compiling static TagLib 1.6.3 libraries for Windows -

PostgreSQL 9.x - pg_read_binary_file & inserting files into bytea -

asp.net - call stack missing info on mono with apache and mod_mono -