Created
          June 22, 2017 00:47 
        
      - 
      
- 
        Save sayhicoelho/f8d2a510b523d284406f87174197aff2 to your computer and use it in GitHub Desktop. 
    Replace string between
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| function replace_between($str, $needle_start, $needle_end, $replacement = '') | |
| { | |
| return preg_replace('/' . $needle_start . '.+?' . $needle_end . '/sm', $replacement, $str); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment