how to insert data array to another array

how to insert data array to another array

I want to check if the data is same then don't print the data but push that data to the first data.

I want to check if the data is same then don't print the data but push that data to the first data.

for example I have data array like this:

0 => array:4 [▼
    "StartTime" => "00:00:00"
    "type" => 1
    "DateAppointment" => "2019-02-24"
    "SDay" => "Sun"
  ]
1 => array:4 [▼
    "StartTime" => "00:00:00"
    "type" => 1
    "DateAppointment" => "2019-02-25"
    "SDay" => "Mon"
  ]
2 => array:4 [▼
    "StartTime" => "00:00:00"
    "type" => 1
    "DateAppointment" => "2019-02-26"
    "SDay" => "Tue"
  ]
3 => array:4 [▼
    "StartTime" => "00:10:00"
    "type" => 1
    "DateAppointment" => "2019-02-24"
    "SDay" => "Sun"
  ]

data array 0, 1, 2 has the same StartTime, so I want my data to be like this

0 => array:10 [▼
    "StartTime" => "00:00:00"
    "type" => 1
    "DateAppointment" => "2019-02-24"
    "SDay" => "Sun"
    "type1" => 1
    "DateAppointment1" => "2019-02-25"
    "SDay1" => "Mon"
    "type2" => 1
    "DateAppointment2" => "2019-02-26"
    "SDay2" => "Tue"
  ]
1 => array:4 [▼
    "StartTime" => "00:10:00"
    "type" => 1
    "DateAppointment" => "2019-02-24"
    "SDay" => "Sun"
  ]

is that possible?

my script is like this

$interval = 10;
$hourMinInterval = 60 - $interval;
for ($i = 0; $i <= 23; $i++){
    for ($j = 0; $j <= $hourMinInterval; $j+=$interval){

    $h = sprintf('%02d',$i);
    $m = sprintf('%02d',$j);
    $clock[] = $h.':'.$m.':00';

    if ($lastdate != 'lastsunday') {
        $timestampa = $lastdate;
    } else {
        $timestampa = strtotime('last Sunday');
    }

    for($ble=0;$ble&lt;7;$ble++){
        $timeC = sprintf('%02d',$i).':'.sprintf('%02d',$j).':00';
        $tgla = strftime('%Y_%m_%d', $timestampa);
        $dateS = str_replace('_','-',$tgla);
        $sday = strftime('%a', $timestampa);
        $timeCs = array('StartTime'=&gt;$timeC, 'type'=&gt;1, 'DateAppointment'=&gt;$dateS, 'SDay'=&gt;$sday);
        $timestampa = strtotime('+1 day', $timestampa);

        if ($timeC == $timeCs['StartTime']) {
            $statusssss[] = $timeCs;
        }else{
            $statusssss[] = '';
        }
    }
}

}

If you have another way or any example with jsfiddle will be appreciated.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

PHP Interview Questions with Solutions: Prepare for PHP Interview

Prepare for PHP Interviews. Set Variable With php.ini File. Logic & Output Behind PHP Code Segment. Class Concept, Error & Functions in PHP. Start PHP Now!

PHP Web Application Development Company

As a top **PHP Web Application Development Company in USA**[https://www.dataeximit.com/php-development-services/](https://www.dataeximit.com/php-development-services/ "https://www.dataeximit.com/php-development-services/"), we at Data EximIT have...

Advantages of Hiring PHP Developer for your Website Project

PHP - Hypertext pre-processor, a scripting language used by many people in developing web pages, but most of us are unaware even of the full form. To train someone and make them learn this whole language is as difficult and time-consuming as it is...