title: PHP array not printing
body: <p>My print array is not working. it echos out the $articleID just before adds to the array so the variable is not null or anything. </p>
  
  <p>Then i print_r($magIDArray) and it just echo's out 'Array( )'; Can anyone help?</p>
  
  <p><b>EDIT:</b> I have called the function otherwise it wouldn't echo the variables in the function - It wouldent echo $articleID, but it has done</p>
  
  <pre><code>$sql = mysql_query("SELECT * FROM master_k2_categories WHERE parent = '$catid' ORDER 
  BY id DESC");
  while($row = mysql_fetch_array($sql)){
      $id = $row["id"];
      $name = $row["name"];
      getMagArticleID($id); 
  }
  
  $magIDArray = array();
  function getMagArticleID($id){
      $magID = $id;
      $sqlID = mysql_query("SELECT * FROM master_k2_items WHERE catid = '$magID' ORDER BY id DESC");
      while($row = mysql_fetch_array($sqlID)){
          $articleID = $row["id"];
          echo '&lt;br&gt;', $articleID;
          $magIDArray[] = $articleID;
      }
  }
  print_r($magIDArray);
  </code></pre>