backslashit

Adds backslashes before letters and before a number at the start of a string.

Description

(string) backslashit( (string) $string ); 

Returns (string)

String with backslashes inserted.

Parameters (1)

0. $string (string)
Value to which backslashes will be added.

Usage

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

Defined (1)

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

/bp-forums/bbpress/bb-includes/backpress/functions.formatting.php  
  1. function backslashit($string) { 
  2. $string = preg_replace('/^([0-9])/', '\\\\\\\\\1', $string); 
  3. $string = preg_replace('/([a-z])/i', '\\\\\1', $string); 
  4. return $string;