首先看看preg替换有多复杂。通常,您可能会在这方面出错。
NODE EXPLANATION
--------------------------------------------------------------------------------
/ \'/\'
--------------------------------------------------------------------------------
\\( \'(\'
--------------------------------------------------------------------------------
\\s* whitespace (\\n, \\r, \\t, \\f, and " ") (0 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
post_title \'post_title\'
--------------------------------------------------------------------------------
\\s+ whitespace (\\n, \\r, \\t, \\f, and " ") (1 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
LIKE \'LIKE\'
--------------------------------------------------------------------------------
\\s* whitespace (\\n, \\r, \\t, \\f, and " ") (0 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
( group and capture to \\1:
--------------------------------------------------------------------------------
\\\' \'\'\'
--------------------------------------------------------------------------------
[^\\\']+ any character except: \'\\\'\' (1 or more
times (matching the most amount
possible))
--------------------------------------------------------------------------------
\\\' \'\'\'
--------------------------------------------------------------------------------
) end of \\1
--------------------------------------------------------------------------------
\\s* whitespace (\\n, \\r, \\t, \\f, and " ") (0 or
more times (matching the most amount
possible))
--------------------------------------------------------------------------------
\\) \')\'
--------------------------------------------------------------------------------
/", " \'/", "\'
--------------------------------------------------------------------------------
( group and capture to \\2:
--------------------------------------------------------------------------------
post_title LIKE \'post_title LIKE \'
--------------------------------------------------------------------------------
$ before an optional \\n, and the end of
the string
--------------------------------------------------------------------------------
1 \'1\'
--------------------------------------------------------------------------------
) end of \\2
--------------------------------------------------------------------------------
OR \' OR \'
--------------------------------------------------------------------------------
( group and capture to \\3:
--------------------------------------------------------------------------------
geotag_city LIKE \'geotag_city LIKE \'
--------------------------------------------------------------------------------
$ before an optional \\n, and the end of
the string
--------------------------------------------------------------------------------
1 \'1\'
--------------------------------------------------------------------------------
) end of \\3
--------------------------------------------------------------------------------
OR \' OR \'
--------------------------------------------------------------------------------
( group and capture to \\4:
--------------------------------------------------------------------------------
geotag_state LIKE \'geotag_state LIKE \'
--------------------------------------------------------------------------------
$ before an optional \\n, and the end of
the string
--------------------------------------------------------------------------------
1 \'1\'
--------------------------------------------------------------------------------
) end of \\4
--------------------------------------------------------------------------------
OR \' OR \'
--------------------------------------------------------------------------------
( group and capture to \\5:
--------------------------------------------------------------------------------
geotag_country \'geotag_country LIKE \'
LIKE
--------------------------------------------------------------------------------
$ before an optional \\n, and the end of
the string
--------------------------------------------------------------------------------
1 \'1\'
--------------------------------------------------------------------------------
) end of \\5
接下来,您需要提供
full 之后的SQL查询示例
preg_replace
.
如果我们可以拥有完整的SQL查询,那么我们也可以理解定制。
查看您编写的内容,我们需要您为WP\\u查询设置的参数,以了解您是如何组织查询的。
更多CONCAT
这不是一件聪明的事情,它迫使MySQL连接字符串;减速系数。
希望这可能会有所帮助。