gpt4 book ai didi

PHP使用函数返回值作为数组

转载 作者:行者123 更新时间:2023-12-04 21:18:52 25 4
gpt4 key购买 nike

为什么会这样:

        $cacheMatchesNotPlayed = $cache->load('externalData');
$cacheMatchesNotPlayed = $cacheMatchesNotPlayed['matchesNotPlayed'];

但这行不通:

        $cacheMatchesNotPlayed = $cache->load('externalData')['matchesNotPlayed'];

有什么原因吗?第二位比较容易写。

最佳答案

因为 PHP 不支持这种语法。

关于PHP使用函数返回值作为数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2851465/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com