gpt4 book ai didi

PHP MYSQL 多维数组提取值

转载 作者:行者123 更新时间:2023-12-01 00:49:12 25 4
gpt4 key购买 nike

我的数组:

Array
(
[0] => Array
(
[mobileNumber] => 5555555
[message] => test
)

[1] => Array
(
[mobileNumber] => 555555
[message] => test
)

[2] => Array
(
[mobileNumber] => 555555
[message] => test
)

[3] => Array
(
[mobileNumber] => 5555555
[message] => test
)

[4] => Array
(
[mobileNumber] => 77255552233
[message] => test
)

)

循环

foreach ($NumbersArray as $number => $message) {
echo "Number: $number Message: $message<br/>";
echo "<br/>";
}

这是我的结果:

Number: 0 Message: Array

Number: 1 Message: Array

Number: 2 Message: Array

Number: 3 Message: Array

Number: 4 Message: Array

我想要的是:

 Number: 55555 Message: test

最佳答案

呃……就这样吧

 foreach($NumbersArray as $val){
echo "Number : ".$val['mobileNumber']. " | Message : ".$val['message'];
}

除非我误解了你的问题..??

关于PHP MYSQL 多维数组提取值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17935087/

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