我找不到说明如何操作的文档。我在我的网站的搜索结果中动态显示帖子描述的一部分。
例子:
<?php
$extract = "Include all the information someone would need to answer your question.";
$search = "format";
$num = stripos($extract,$search);
$to_show = substr($extract,$num, 17);
echo $to_show;
?>
结果:
formation someone
我希望能够显示“信息”而不是“形成”。有什么建议吗?