Php how to merge arrays according to the same key value in the same array

I am a novice. I hope the boss can help solve

.

Code:
foreach ($row as $key= > $str)

    {
        if ($key > 0)
        {
            $img = substr($str, 0);
            $img = preg_match_all("/<img[^>]*>/", $img,$pic);
            foreach ($pic[0] as $v)
            {
                $v = substr($v,strpos($v,"src")+5);
                $databaseImg = [];
                $databaseImg[$key][]= substr($v,0,strpos($v," "));
            }
        }
    }
Php
Mar.31,2021

the array above you is a containing array, which contains an array and then an array, which is equal to the second level containing no root
similar

.
[
    [x => [xxx]],
    [x => [xxx]],
    [x => [xxx]]
]

if you want to remove x as key, then the code is:

$databaseImg= [];
foreach ($row as $key => $item)
{
    foreach ($item as $k => $v)
    {
        if ($v) {
            $databaseImg[$k][]= $v[0];
        }
        //$v
        //foreach ($v as $vv) {
        //    $databaseImg[$k][]= $vv;
        //}
    }
}

array_merge
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c086-2c2ea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c086-2c2ea.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?