【发布时间】:2017-02-13 13:15:54
【问题描述】:
就像它的描述栏很长,但我想在另一个页面上从中获取一些行,
$desc=$result_set['Description'];
来自数据库我想在 p 标签中回显,但它的某些行不是完整的描述
【问题讨论】:
-
substr() 正是您想要的。你也可以在 mysql 端缩减它
-
在 mysql 结束时:-stackoverflow.com/a/2080871/4248328 和 substr():-w3schools.com/php/func_string_substr.asp
-
@Anant wordwrap 不会缩短数据,只添加断点会很有用
-
@Keerthivasan 在你说之前我已经删除了那个