2014-05-05 59 views

回答

0

對於Unicode字符,你需要使用mb_strlen()mb_substr()

重寫上面的線

$title = (mb_strlen($title,'utf-8')<60) ? $title : mb_substr($title,0,50,'utf-8')."..."; 
+0

Iam得到這個錯誤:警告:strlen()期望恰好有1個參數,2給出/ home /oranews/public_html/wp-content/themes/oranews/loop-single.php 44行 –

+0

我說'mb_strlen()'爲什麼你仍然在使用'strlen()'? –

+0

我使用它mb_strlen()但我的頁面顯示空白:( –