gpt4 book ai didi

php - 从描述中搜索单词并返回从该单词开始的描述

转载 作者:行者123 更新时间:2023-11-29 20:09:59 25 4
gpt4 key购买 nike

是否有任何功能可以从描述中搜索单词并返回从该单词开始或仅返回该搜索单词之前的单词的描述?

如果这是描述..

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.

我想搜索“打印”这个词。结果必须像这样显示..

printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

或者

the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s

结果将显示我正在搜索的单词或仅搜索单词之前的一个单词。

最佳答案

您应该在此处阅读有关 MySQL 内置函数的信息: http://dev.mysql.com/doc/refman/5.7/en/string-functions.html

SELECT SUBSTRING(description FROM LOCATE('printing', description))
...

关于php - 从描述中搜索单词并返回从该单词开始的描述,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40200301/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com