vividona Posted November 23, 2011 Share Posted November 23, 2011 I used this code $limit = 120; if (strlen($summary) > $limit) $summary = substr($summary, 0, strrpos(substr($summary, 0, $limit), ' . . .')); This code ok in English Language it counts letters fine but it is not work fine if I insert Arabic text. It counts Arabic encoding characters. Link to comment https://forums.phpfreaks.com/topic/251673-make-brief-to-contents/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 23, 2011 Share Posted November 23, 2011 There are multi-byte string functions - http://us3.php.net/manual/en/ref.mbstring.php Link to comment https://forums.phpfreaks.com/topic/251673-make-brief-to-contents/#findComment-1290701 Share on other sites More sharing options...
vividona Posted November 23, 2011 Author Share Posted November 23, 2011 I tried it many time. But nothing changed Link to comment https://forums.phpfreaks.com/topic/251673-make-brief-to-contents/#findComment-1290705 Share on other sites More sharing options...
PFMaBiSmAd Posted November 24, 2011 Share Posted November 24, 2011 If you want help with some specific code you tried, you would need to post it along with some sample data. Also, state what didn't work when you tried it. Link to comment https://forums.phpfreaks.com/topic/251673-make-brief-to-contents/#findComment-1290967 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.