PHP - save an Array if a value are missing
<p>I want to save two arrays in an array. 
This example works</p>

<pre><code>    $myArray = [];
    $a = [1,2,3,4];
    $b = [1,2,3,4];
</code></pre>

<p>Output </p>

<pre><code>Array
(
 [a] =&gt; Array
   (
   [0] =&gt; 1
   [1] =&gt; 2
   [2] =&gt; 3
   )
 [b] =&gt; Array
   (
   [1] =&gt; 11
   [2] =&gt; 22
   [3] =&gt; 33
 )
)
</code></pre>

<p>My problem is when in an array, a value is missing then it comes to an error</p>

<pre><code>Array
(
 [a] =&gt; Array
  (
   [0] =&gt; 1
   [1] =&gt; 2
   [2] =&gt; 3
  )
 [b] =&gt; Array
  (
   [1] =&gt; 11
   [2] =&gt; 
   [3] =&gt; 33
  )
)
</code></pre>

<p>I would need output like this. If a value is missing</p>

<pre><code>Array
(
 [a] =&gt; Array
  (
   [0] =&gt; 1
   [2] =&gt; 3
  )
   [b] =&gt; Array
  (
   [1] =&gt; 11
   [3] =&gt; 33
  )
)
</code></pre>

<p>How can i do it? 
Thank you.</p>