title: PHP arrays. inserting "$key" => "$value" pair into array with array_push();
body: <p>Why won't this work?</p>
  
  <pre><code>$slidetotal=1;      
  $slideids = array();
      while ($rowcs = mysql_fetch_array($orig_slides_result)) {
      $key = $slidetotal;
      array_push($slideids[$key], $rowcs['id']);
      $slidetotal++;
      }
  </code></pre>
  
  <p>I get this error:
  [phpBB Debug] PHP Notice: in file /<strong><em>/</em></strong>/<em><strong></em>*</strong>.php on line 161: array_push() [function.array-push]: First argument should be an array</p>
  
  <p>Although someone has commented you can do this on this page:
  <a href="http://php.net/manual/en/function.array-push.php" rel="nofollow">http://php.net/manual/en/function.array-push.php</a> , (find: "to insert a "$key" => "$value" pair into an array")</p>
  
  <p>What is the next best way to insert a list of single values into a php array? By the way, I really can't believe it's hard to find something on this with google.com. Seriously?</p>