Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下代码从帖子内容中提取前三十个单词:
$extract = explode (' ', $post->post_content); $first_thirty = array_slice($extract, 0, 30); echo $first_thirty;
但是当我echo $first_thirty;打印“数组”时,我怎样才能正确打印它。
echo $first_thirty;
将前三十个单词组合回一个字符串,然后回显它:
echo implode(' ', $first_thirty);