php无left函数,要用substr函数
echo '  '.substr($content,0,200).chr(0);

解决方案 »

  1.   

    <?
    @db_connect();$query = "select * from instructor  where lx='$tempid'";$result = @mysql_query($query, $GLOBALS['db_handle']);
    $i=0;
    while($row = @mysql_fetch_array($result)){         if($i>20) break;
     if (($i % 2) == 0)
    {
    $bg_color = "#F3F3F3";
    }
    else
    {
    $bg_color = "#ffffff";
    }
    ?>
                      <table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
                        <tr bgcolor=<?=$bg_color?>> 
                          <td height="4"> 
                            <?echo '<img src="/images/ball.gif" width="7" height="6" type=square>&nbsp;<a href="javascript:nav(\'note.php?topid='.$row['id'].'\',0,0,0)"  >'.$row['title'].'</a>';?>
                          </td>
                        </tr>
                        <tr bgcolor=<?=$bg_color?>> 
                          <td height="4"> 
                            <?
    echo '.substr('.$row['content'].',0,200).chr(0)';
    ?>
                          </td>
                        </tr>
                      </table>
                      <?$i++;
      }
    ?>
      

  2.   

    唠叨的方法是最简单的。
    <?
    echo substr("abcdef", 1, 3);  // 传回 "bcd"
    echo substr("abcdef", -2);    // 传回 "ef"
    echo substr("abcdef", -3, 1); // 传回 "d"
    echo substr("abcdef", 1, -1); // 传回 "bcde"
    ?> 对了,你ECHO $content试试,变量过去了吗。别折腾半天,根本没搞上
      

  3.   

    echo '.substr('.$row['content'].',0,200).chr(0)';
    我是这样写的,可显示的是全部的内容啊!
      

  4.   

    echo substr($row['content'],0,200).chr(0);