Maximum length of RSS description item

本小妞迷上赌 提交于 2019-12-05 03:59:36

As I know there are not a length limit. 2

In RSS 0.91, various elements are restricted to 500 or 100 characters. There can be no more than 15 < item >s in a 0.91 < channel >. There are no string-length or XML-level limits in RSS 0.92 and greater. Processors may impose their own limits, and generators may have preferences that say no more than a certain number of < item >s can appear in a channel, or that strings are limited in length.

Rss 2.0

For all elements defined in the RSS specification that enclose character data, the text should be interpreted as plain text with the exception of an item's description element, which must be suitable for presentation as HTML. All of these elements must not contain child elements.

There's no limit on the length of character data that can be contained in an RSS element.

So do you want to cut text somewhere and add ...? In this case just use substr.

$description = substr($description, 0, 250)."...";

Replace 250 by the size you want.

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