[英]PHP how to get value from array with foreach
I have array $result 我有数组$ result
array(2) {
["Smiley TV"]=>
array(2) {
["Speed"]=>
array(2) {
[0]=>
string(4) "9510"
[1]=>
string(5) "33775"
}
["Turbo"]=>
array(2) {
[0]=>
string(4) "2427"
[1]=>
string(5) "19696"
}
}
["Victory Media"]=>
array(1) {
["Speed"]=>
array(2) {
[0]=>
string(4) "4144"
[1]=>
string(5) "80445"
}
}
}
How with foreach i can get values. 如何与foreach我可以获得价值。 For example in the "Smyley TV" how i can result "Speed". 例如,在“ Smyley TV”中,我如何得到“ Speed”。 Also please write how i can get all data one by one. 还请写我如何一一获取所有数据。 Thanks 谢谢
You can fetch this way 你可以这样
foreach ($arrays as $array) {
echo $array['smyley TV'];
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.