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

drupal - using views argument in the view tpl.php file -

php - Posting PHPBB Forum Thread/Post info in a website -

php - Add a blog by sending a mail to a certain emailadress -