摘要:
例子来自PHP官方文档,我只是翻译下。http://www.php.net/manual/zh/function.mb-strcut.phpheader( 'Content-Type:text/html;charset=utf-8 ');mb_internal_encoding('UTF-8');$string = 'cioèòà';var_dump(substr($string, 0, 6),mb_substr($string, 0, 6),mb_strcut($string, 0, 6));输出:Output:s 阅读全文
摘要:
今天遇到一个问题,数据库中保存的内容通过php在页面无法显示,如果将内容换行或加个空格或者随便加点其他内容就能正常显示。非常的诡异,显示的内容是通过截取得到的。代码非常简单substr($pMarketInfo['description'], 0, 150) . '...';原始内容是:Set on a huge 809m2 block, there is plenty of room for the pets and the little ones and with side access• Floor to ceiling tiles in the bath 阅读全文