//循环 $_str="";while($row = mysql_fetch_row($result)) { $_str .=<<{$row[0]}{$row[1]}doc;}这样就可以了,你在模板里直接print $_str;就行了<<和doc;后面被百度加了个空格,自己删掉