Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




like_escape [ WordPress Function ]

like_escape ( $text )
Parameters:
  • (string) $text The text to be escaped.
Returns:
  • (string) text, safe for inclusion in LIKE query.
Defined at:



Escapes text for SQL LIKE special characters % and _.

Source


<?php
function like_escape($text) {
    return 
str_replace(array("%""_"), array("\\%""\\_"), $text);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics