PHPで(知らずに)以下のようなコードを書いていてはまったのでメモ。 実にくだらない話なんだが‥ <?php $a = array( 'hoge' => 'HOGEHOGE', 'uga' => array( 'text' => 'UGAUGA', 'shortText' => 'UGA', ), ); var_dump(PHP_VERSION); $textList = array(); foreach (array('hoge', 'uga') as $key) { if (isset($a[$key]['text'])) { $textList[$key] = $a[$key]['text']; } else if (isset($a[$key])) { $textList[$key] = $a[$key]; } else { $textList[$key] = $key; } }