次のような配列があるとします。
$array = array
("this","is","me","and","I","am","an","array","hello","beautiful","world");
0 を「A」に、1 を「B」に変換する関数を作成するにはどうすればよいですか? 使うForeach
か…?
そのため、代わりに
Array
(
[0] => this
[1] => is
[2] => me
[3] => and
[4] => I
[5] => am
[6] => an
[7] => array
[8] => hello
[9] => beautiful
[10] => world
)
私は得るだろう
Array
(
['A'] => this
['B'] => is
['C'] => me
['D'] => and
['E'] => I
['F'] => am
['G'] => an
['H'] => array
['I'] => hello
['J'] => beautiful
['BA'] => world
)