Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
数値キーで配列を作成し、項目を任意のキー番号に割り当てることはできますか?
すなわち
$test = array(23=>'first thing', 245=>'second thing');
特にIDを値に割り当てるようなものを構築することを考えている場合は、本質的に問題はありません。値を見つけるためにループするようなことをしている場合はfor($i=0;$i<1000000;$i++)、そうです、それをどのように書いているかを再考したいかもしれません。
for($i=0;$i<1000000;$i++)
はい
はい、それは連想配列であり、それが便利です。