php二维数组转成字符串示例

2015-01-24信息快讯网

这篇文章主要介绍了php二维数组转成字符串示例,需要的朋友可以参考下

function arr2str ($arr)
{
    foreach ($arr as $v)
    {
        $v = join(",",$v); //可以用implode将一维数组转换为用逗号连接的字符串
        $temp[] = $v;
    }
    $t="";
    foreach($temp as $v){
        $t.="'".$v."'".",";
    }
    $t=substr($t,0,-1);
    return $t;
}

©2014-2024 dbsqp.com