fork(1) download
  1. <?php
  2.  
  3. $test = [
  4. ['langVar' => 'text1', 'translation' => 'translation1'],
  5. ['langVar' => 'text2', 'translation' => 'translation2'],
  6. ['langVar' => 'text3', 'translation' => 'translation3'],
  7. ['langVar' => 'text4', 'translation' => 'translation4'],
  8. ['langVar' => 'text5', 'translation' => 'translation5'],
  9. ];
  10.  
  11. $EN = [];
  12. foreach ($test as $row) {
  13. $EN[$row['langVar']] = $row['translation'];
  14. }
  15.  
  16. print_r($EN);
Success #stdin #stdout 0.02s 26304KB
stdin
Standard input is empty
stdout
Array
(
    [text1] => translation1
    [text2] => translation2
    [text3] => translation3
    [text4] => translation4
    [text5] => translation5
)