<?php include("../sql/conn.php");  ?>


<?php 
//截取中文字符串 
function mysubstraa($str, $start, $len) { 
$tmpstr = ""; 
$strlen = $start + $len; 
for($i = 0; $i < $strlen; $i++) { 
if(ord(substr($str, $i, 1)) > 0xa0) { 
$tmpstr .= substr($str, $i, 2); 
$i++; 
} else 
$tmpstr .= substr($str, $i, 1); 
} 
return $tmpstr; 
} 
?> 


<?php
$result1 = mysql_query("SELECT * FROM wz WHERE fl = 'web1' or fl = 'web' order by id DESC limit 0,12");
while($row1 = mysql_fetch_array($result1))
{
echo "<div id=nr3 >";
echo "<a target=_blank  href=wz_".$row1['id'].".html  class='two'   >";
  $tm = mysubstraa($row1['tm'],0,32); 
  
//////////////////循环替换////////////////////
$result8 = mysql_query("SELECT * FROM ck");
while($row8 = mysql_fetch_array($result8))
  {
$tm = str_replace($row8['old'],$row8['new'],$tm);
  }
//////////////////循环替换////////////////////


echo $tm;
echo "</a></div>";
}
?>


<?php include("../sql/close.php"); ?>

