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.
我有以下代码不必要地占用 2 行:
<?php $items = get_my_items(); $item4 = $items[4]; // get_my_items()[4] # invalid code ?>
我不是初学者,但这个小东西一直很紧张......有什么建议吗?
这称为数组解引用。它从 PHP 5.4 开始可用。如果需要,请升级您的 PHP。