title: Convert 1D Array to 2D Array and Join PHP
body: <p>I have this unidimensional array:</p>
  
  <p>$array1:</p>
  
  <pre><code>Array
  (
      [coupon_code] =&gt; GTY777R
      [coupon_description] =&gt; Credito $5 USD
  )
  </code></pre>
  
  <p>$array2: (2D Array)</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [coupon_code] =&gt; 0000000
              [coupon_description] =&gt; Intenta de nuevo
          )
  
      [1] =&gt; Array
          (
              [coupon_code] =&gt; 0000000
              [coupon_description] =&gt; Intenta de nuevo
          )
  
  )
  </code></pre>
  
  <p>I need to check if $array1 is a Unidimentional Array and convert it before join, for example:</p>
  
  <pre><code>if (is_1D($array1) = TRUE) {
    $array1 = convert_2D($array1);
  }
  $array3 = join_arrays($array1, $array2);
  </code></pre>
  
  <p>Final Result $array1 converted to 2D and joined:
  $array3</p>
  
  <pre><code>Array
  (
      [0] =&gt; Array
          (
              [coupon_code] =&gt; 0000000
              [coupon_description] =&gt; Intenta de nuevo
          )
  
      [1] =&gt; Array
          (
              [coupon_code] =&gt; 0000000
              [coupon_description] =&gt; Intenta de nuevo
          )
  
      [2] =&gt; Array
          (
              [coupon_code] =&gt; GTY777R
              [coupon_description] =&gt; Credito $5 USD
          )
  
  )
  </code></pre>