Limit number of characters and put read more link

谁说我不能喝 提交于 2019-12-11 01:43:42

问题


I am using in place ckeditor with jquery drag and drop. I want to limit the number of characters to 20 and put the read more link. Can anyone tel me, how can i do this.


回答1:


Not sure if this will work inside your editor but does limit the characters when displayed on html page on frontend:

<html>
<body>
<?PHP 
$chars = 20;
$desc = substr($ckeditorcontent,0,$chars); 
echo $desc ."...";?><a href="#" title="More info">More</a>
</body>
</html>


来源:https://stackoverflow.com/questions/6332305/limit-number-of-characters-and-put-read-more-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!