gpt4 book ai didi

php - 检测数组是索引的还是关联的

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:51:15 25 4
gpt4 key购买 nike

这个问题在这里已经有了答案:




11 年前关闭。




Possible Duplicate:
PHP Arrays: A good way to check if an array is associative or sequential?



在 PHP 中检查数组是否关联的最高效方法是什么?

最佳答案

如果是为了遍历数组,为了安全起见,您始终可以使用 foreach。

关于php - 检测数组是索引的还是关联的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1326183/

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