Skip to content

Instantly share code, notes, and snippets.

@Rosenstein
Created May 19, 2021 22:09
Show Gist options
  • Save Rosenstein/9690365870bc5d5c394e2ceeac803a8f to your computer and use it in GitHub Desktop.
Save Rosenstein/9690365870bc5d5c394e2ceeac803a8f to your computer and use it in GitHub Desktop.
/**
* Remove defined words from string
*
* @param string $input the input string
* @return string the modified string
*
* Function taken from https://gist.github.com/keithmorris/4155220 / Rosenstein
**/
function removeWords($input){
// EEEEEEK Stop words
$Words = array(' ','MariaDB', '-');
return preg_replace('/\b('.implode('|',$Words).')\b/','',$input);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment