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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

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