echo "<a href = \"#\">".substr($buffer,0,12)."...</a>";              输出文本文件的内容
或者

解决方案 »

  1.   

    如果你只是要作为标题显示的话,楼上的也不防是个方法;
    如果你打算把整个内容都放进去的话,可以试试样式表来控制,比方说:
    $string = "select * from my_stuinfo where username='$str'from my_stuinfo where username='$str'from my_stuinfo where username='$str'from my_stuinfo where username='$str'";
    echo "<a href = \"#\"><div style=\"width:30 px;height:30 px;overflow:hidden;cursor:hand;\">$string</div></a>";//你可以控制width来设置你要的长度