我打電話給所有名字從一個MySQL數據庫使用PHP。有些名字非常大。所以我想顯示前7個charectors,並把 「...」修剪數據庫中的內容?
這裏是我的代碼:
<?php $result = mysql_query("SELECT * FROM Persons WHERE section='one' ORDER BY FirstName");
while($row = mysql_fetch_array($result))
{
$fst = $row['FirstName']; ?>
任何建議嗎?
不希望是這樣的(johnseb ...)? – geovani075
'substr'也許......?! – deceze
是的,多數民衆贊成 – alon1234