like_escape

Formerly used to escape strings before searching the DB.

Description

(string) like_escape( (string) $text ); 

Returns (string)

text, safe for inclusion in LIKE query.

Parameters (1)

0. $text (string)
The text to be escaped.

Usage

  1. if ( !function_exists( 'like_escape' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php'; 
  3.  
  4. // The text to be escaped. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = like_escape($text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php  
  1. function like_escape($text) { 
  2. return addcslashes($text, '\\%_');