搜索段落中的句子
如何使用 PHP 在段落中搜索一个或多个句子?
How can I search a paragraph for one or more sentences using PHP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何使用 PHP 在段落中搜索一个或多个句子?
How can I search a paragraph for one or more sentences using PHP?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
是的。
strpos
会告诉你字符串中是否存在一个字符串。Yes.
strpos
will tell you whether a string exists within a string.看看这里,也许此处 和此处。
Have a look over here, maybe here and here.
好吧,如果可能的话,您可能希望使用“preg_match()”(需要了解正则表达式)尽管)。如果您确切地知道要查找什么,“strstr()”也可以工作。
Well, you'll probably want to use "preg_match()" if possible (requires knowledge of regular expressions though). "strstr()" works too if you know exactly what you want to find.