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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -