Escapes text for SQL LIKE special characters % and _.
Signature
like_escape( $text )
- text
- (string) The text to be escaped.
Return
(string) text, safe for inclusion in LIKE query.
Source
function like_escape($text) {
return str_replace(array("%", "_"), array("\\%", "\\_"), $text);
}
WP Trac GitHub Bitbucket
Link here
-
URL
http://queryposts.com/function/like_escape/ -
HTML
<a href='http://queryposts.com/function/like_escape/'>like_escape()</a> -
Markdown
[like_escape()](http://queryposts.com/function/like_escape/) -
BBCode
[url=http://queryposts.com/function/like_escape/]like_escape()[/url]