乱码一般是编码问题,你数据库使用的编码和页面编码没有统一
while ($sqldata = mysql_fetch_row($sqlinfo)) { $keys = ""; $values = ""; foreach ($sqldata as $key => $value) { $keys .= $keys . " "; $values .= $value . " "; } echo $keys."\n"; echo $values . "\n";}