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.
ほとんどの場合、func1 という名前の関数があり、それが配列を返す場合、このメソッドを使用して、返された配列の特定のインデックスにアクセスします。
$myarray=func1(); echo $myarray['AssIndex'];
一行でアクセスする方法はありますか?このようなもの?
// the brackets are not working. this is only to make my meaning clear. echo {func1}['AssIndex'];
PHP 5.4 以降では、これを行うことができます。
echo func1()['AssIndex'];
これは、関数配列逆参照と呼ばれます。