本来他的位置就是2了的啊
要想取apple在这个数组中的位置
可以用
$temp=array_keys($stack,"apple")
不过返回是个数组
要是你的东西唯一 就用$temp[0]可以了
不知道你是不是要这样