//将数组拆分为字符串 $attr=$db->Query($sql); $str=""; foreach($attr as $v) { $str =$str. implode("^",$v); $str = $str."|"; } $str = substr($str,0,strlen($str)-1); echo $str; //将字符串拼接为数组 var hang = data.split("|"); for(var i=0;i<hang.length;i++) { var lie = hang[i].split("^"); for(var j=0;j<lie.length;j++) { } }
时间: 2024-11-13 08:51:02