title: Combine One array to several array
body: <p>I have following content:</p>
  
  <pre><code>$staticArray = ['group_1', 'group_2'];
  
  foreach ($staticArray as $name){
      $names[] = $name;
  }
  
  $staticArray2 = ['one', 'two'];
  
  $i = 0;
  foreach ($staticArray2 as $name){
  
      $item['group']['name']   = $names;
      $item['group']['user_1']   = 'Peter';
      $item['group']['user_2'] = 'Jack';
  
      $groups[] = $item;
  
      $i++;
  }
  </code></pre>
  
  <p>The above code output is like this:</p>
  
  <pre><code>[ {
  group: {
      name: [
         "group_1",
         "group_2",
         "group_1",
         "group_2"
     ],
      user_1: "Peter",
      user_2: "Jack"
     }
  },
  
  {
  group: {
     name: [
        "group_1",
        "group_2",
        "group_1",
        "group_2"
     ],
     user_1: "Peter",
     user_2: "Jack"
    }
  } ]
  </code></pre>
  
  <p>How can I edit first code to look like this:</p>
  
  <pre><code>{
     group: {
        name: "group_1", //group 1
        user_1: "Peter",
        user_2: "Jack"
     },
     group: {
        name: "group_2", //group 2
        user_1: "Peter",
        user_2: "Jack"
     }
  }
  </code></pre>
  
  <p><strong>$staticArray</strong> and <strong>$staticArray2</strong> is a two static variable, so these 2 items cannot be <strong>editable.</strong></p>
  
  <p>If you don't understand what I mean. Read this:</p>
  
  <p>I have two array:</p>
  
  <pre><code>$legues = [ 'Laliga', 'Bundesliga', '...' ];
  
  $teams  = [ 'FC Barcelona', 'RCD Mallorca', 'UD Levante', 'CF Valencia', 'FC Salzburg', 'WSG Tirol' ];
  </code></pre>
  
  <p>First league is "Laliga" and this league have 4 team: FC Barcelona , RCD Mallorca, UD Levante and CF Valencia.</p>
  
  <p>Second league is "Bundesliga" and this league have 2 team: FC Salzburg and WSG Tirol.</p>
  
  <p>Now I want to put this teams to the league (like my last output code).</p>