str_lreplace

The SKT Biz str lreplace function.

Description

str_lreplace( $search, $replace, $subject ); 

Parameters (3)

0. $search
The search.
1. $replace
The replace.
2. $subject
The subject.

Usage

  1. if ( !function_exists( 'str_lreplace' ) ) { 
  2. require_once '/inc/custom-functions.php'; 
  3.  
  4. // The search. 
  5. $search = null; 
  6.  
  7. // The replace. 
  8. $replace = null; 
  9.  
  10. // The subject. 
  11. $subject = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = str_lreplace($search, $replace, $subject); 
  15.  

Defined (1)

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

/inc/custom-functions.php  
  1. function str_lreplace($search, $replace, $subject) { 
  2. $pos = strrpos($subject, $search); 
  3. if($pos !== false) { 
  4. $subject = substr_replace($subject, $replace, $pos, strlen($search)); 
  5. return $subject;