我使用NicEdit作为我的网站的富文本编辑器。在我编辑文本后,它存储在我的数据库中。 说我已经编辑了一些文本,并将其存储这样的内容领域: <div> This is just some sample <b>text that is displayed </b> to help <a href="#"> My example </a> </div>
现在,当我想在我的主页上显示的内容的一些部分
我在我的MySQL数据库中有一个描述字段,并且我在两个不同的页面上访问数据库,其中一个页面显示整个字段,但另一方面,我只想显示前50个字符。如果描述字段中的字符串少于50个字符,则不会显示...,但如果不显示,我将在前50个字符后显示...。 例(完全字符串): Hello, this is the first example, where I am going to have a string