首页 > 解决方案 > 拖尾 html 文本(使用 PHP)

问题描述

询问术语或某些 html/php 代码,您可以在其中删除部分文本。我有一个很长的描述,其中 id 只显示其介绍的一小部分并添加尾随点。通过点击阅读更多它重定向到它的全文。

1

标签: phphtml

解决方案


$text = "this is a long string of text that we need to snip";
$sniplength = 15;

echo substr($text,0,$sniplength)."...";

推荐阅读