【问题标题】:PHP echo Limited Word [duplicate]PHP echo 限制字[重复]
【发布时间】:2019-12-10 06:14:39
【问题描述】:
$string = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";    
echo implode(' ', array_slice(explode(' ', $string), 0, 12));

【问题讨论】:

  • 我不明白你的问题是什么,为什么你只通过复制代码来回答它。
  • 这个问题已经被问了很多次

标签: php


【解决方案1】:
echo implode(' ', array_slice(explode(' ', $string), 0, 12));

【讨论】:

  • 欢迎来到 Stack Overflow!通常不鼓励仅使用代码回答。您能否解释一下为什么它有效或为什么它比其他解决方案更好?
猜你喜欢
  • 2015-07-24
  • 2016-03-23
  • 2011-01-17
  • 1970-01-01
  • 2014-12-08
  • 2014-12-12
  • 1970-01-01
  • 1970-01-01
  • 2014-08-24
相关资源
最近更新 更多