title: How can I append to an array without overwriting or duplicating existing key?
body: <p>The output I have is this:</p>
  
  <pre><code>[price_hidden_label] =&gt; 1
  [categories] =&gt; Array
       (
          [0] =&gt; 26
        )
  </code></pre>
  
  <p>My current code to try and update is:</p>
  
  <pre><code>updateProduct($product-&gt;id, array('categories[108]'));
  </code></pre>
  
  <p>When I run this function, it overwrites the existing array, giving me an output like this:</p>
  
  <pre><code>[price_hidden_label] =&gt; 1
  [categories] =&gt; Array
       (
          [0] =&gt; 108
        )
  </code></pre>
  
  <p>What I am trying to achieve would look like this:</p>
  
  <pre><code>[price_hidden_label] =&gt; 1
  [categories] =&gt; Array
       (
          [0] =&gt; 26
          [1] =&gt; 108
        )
  </code></pre>
  
  <p>But.... in the event that 108 already exists, I would hope that it would just ignore it.  I don't want:</p>
  
  <pre><code>[price_hidden_label] =&gt; 1
  [categories] =&gt; Array
       (
          [0] =&gt; 26
          [1] =&gt; 108
          [2] =&gt; 108
        )
  </code></pre>
  
  <p>Any idea how I do that?</p>