title: Adding items to an array using a function in php does not work
body: <p>I have created an associative array</p>
  
  <pre><code>$prijs = array (
      "Black &amp; Decker Accuboormachine" =&gt; 148.85,
      "Bosch Boorhamer" =&gt; 103.97,
      "Makita Accuschroefmachine" =&gt; 199.20,
      "Makita Klopboormachine" =&gt; 76.00,
      "Metabo Klopboor" =&gt; 119.00        
  );
  </code></pre>
  
  <p>Now I have to add a value to the array and I would like to use a function for this. </p>
  
  <pre><code>function itemToevoegen($array, $key, $value){
      $array[$key] = $value;
  }
  </code></pre>
  
  <p>Then I call the function:</p>
  
  <pre><code>itemToevoegen($prijs, "Bosch GBH 18 V-LI", 412.37);
  </code></pre>
  
  <p>I have tried this without putting the array name in the input parameters but that does not work either. </p>
  
  <p>=================== EDIT =====================
  While typing this I thought I had to return the value, but that does not give me the desired result either.</p>
  
  <pre><code>function itemToevoegen($array, $key, $value){
      return $array[$key] = $value;
  }
  </code></pre>
  
  <p>Could someone help me with this and tell me what I am missing here?</p>
  
  <p>Thanks in advance. </p>