本帖最后由 xianglei1130 于 2013-09-23 17:14:40 编辑

解决方案 »

  1.   

    在foreach之前先定义一下$items=''试试!
      

  2.   


    有的。
    $items = '';
    foreach ($posts as $k=>$p){
    $items.=$p['pro_name'], $p['Discription'], $p['PicUrl'], $p['Url'];
    }
      

  3.   


    有的。
    $items = '';
    foreach ($posts as $k=>$p){
    $items.=$p['pro_name'], $p['Discription'], $p['PicUrl'], $p['Url'];
    }
    那只能说你写错了某个地方,我不信邪还专门试了的,一切正常
    <?php$data = array(
    1 => array(
    'username' => '小子',
    'age' => '二十四'
    ),
    2 => array(
    'username' => '老子',
    'age' => '五十'
    )
    );$items = '';
    foreach ($data as $key => $value) {
    $items.=$valus['username'] . $value['age'];
    }
    echo $items;
      

  4.   


    有的。
    $items = '';
    foreach ($posts as $k=>$p){
    $items.=$p['pro_name'], $p['Discription'], $p['PicUrl'], $p['Url'];
    }

    你的代码不报错??
      

  5.   

    连接符还是用点号吧。貌似逗号只能echo才能用。
    去测试一下呗
      

  6.   

    你用‘.’号连接。。$items.=$p['pro_name'].$p['Discription'].$p['PicUrl'].$p['Url'];........你用逗号竟然没报错?