这个foreach该怎么写?

WBOY
Release: 2016-06-23 14:24:29
Original
1031 people have browsed it

表单提交了2组数组过来:
array(2) {
  ["goods_id1"]=>
  array(2) {
    [0]=>
    string(9) "www.1.com"
    [1]=>
    string(7) "商品1"
  }
  ["goods_id2"]=>
  array(2) {
    [0]=>
    string(9) "www.2.com"
    [1]=>
    string(7) "商品2"
  }
}

怎样把 goods_id1 和 goods_id2 用foreache输出成这样:
商品1
商品2

foreach($_POST as $key => $value)
{
这里应该怎么写?
}


回复讨论(解决方案)

foreach($_POST as $key => $value)
{
  echo "$value[1]";

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template