title: How to push key value of element to array_push using PHP
body: <p>I have created empty array and want to push all values and its key to the new created array but I am getting error array_push() expects at least 2 parameters I know array_push needs two parameter and here I am passing only one but what I ant is all keys and values to be pushed directly to array</p>
  
  <pre><code>//   Here 'userid' is just text or can say sample key and 
   //  Here $userid is getting from table so expected output
  
   //   'userid'=&gt;$userid
  
  $temp = array();
  
    array_push($temp['userid'] = $userid);
  </code></pre>