Created
May 19, 2021 22:09
-
-
Save Rosenstein/9690365870bc5d5c394e2ceeac803a8f to your computer and use it in GitHub Desktop.
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
/** | |
* 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