mercredi 27 mars 2019

How to make nested associative array from two other arrays with PHP or Laravel functions?

I need to make an array that looks like this:

$array = [
      'value_1' => [
        'key' => 'name_1'
      ],
      'value_2' => [
        'key' => 'name_2'
      ]
    ];

From two different array that look like this:

$array_two=['value_1', 'value_2']; $array_three=['name_1', 'name_2'];



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire