title: Merge some array elements in other array and change key name
body: <p>I have a variable array that looks like this when var_dumped:</p>
  
  <pre><code>array (size=2)
    0 =&gt; 
      object(stdClass)[31]
        public 'vacancy_calendar_id' =&gt; string '1' (length=1)
        public 'vacancy_id' =&gt; string '1' (length=1)
        public 'date_from' =&gt; string '2016-08-25 00:00:00' (length=19)
        public 'date_to' =&gt; string '2016-08-27 00:00:00' (length=19)
    1 =&gt; 
      object(stdClass)[30]
        public 'vacancy_calendar_id' =&gt; string '5' (length=1)
        public 'vacancy_id' =&gt; string '1' (length=1)
        public 'date_from' =&gt; string '2016-08-30 00:00:00' (length=19)
        public 'date_to' =&gt; string '2016-08-30 00:00:00' (length=19)
  </code></pre>
  
  <p>Since I dont know how many of these elements will be in the array and I will merge it later with other arrays, I want it to look like this:</p>
  
  <pre><code>array (size=2)
        0 =&gt; 
          object(stdClass)[31]
            public 'vacancy_calendar_id' =&gt; string '1' (length=1)
            public 'vacancy_id' =&gt; string '1' (length=1)
            public 'date_from_0' =&gt; string '2016-08-25 00:00:00' (length=19)
            public 'date_to_0' =&gt; string '2016-08-27 00:00:00' (length=19)
            public 'date_from_1' =&gt; string '2016-08-30 00:00:00' (length=19)
            public 'date_to_1' =&gt; string '2016-08-30 00:00:00' (length=19)
  </code></pre>
  
  <p>And this should go on obviously for other elements, date_from_2, date_to_2, ... </p>