[Solved] How to convert PHP arrays?


You just want to loop over the array and build your newly formatted array.

<?php

$arr = [
    'please' => [
        'text' => 'it'
    ],
    'use' => [
        'text' => 'will'
    ],
    'google' => [
        'text' => 'help'
    ]
];

$formattedArr = [];
foreach ($arr as $k => $v) {
    $formattedArr[$k] = $v['text'];
}

0

solved How to convert PHP arrays?