Skip to content

Commit b265597

Browse files
authored
Update functions.global.php add a clean function
1 parent 05517ed commit b265597

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/functions/functions.global.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,5 +2212,14 @@ function get_album_img($pl)
22122212
return false;
22132213
}
22142214
}
2215+
function TokenCleaner($inputString) {
2216+
// Step 1: Remove non-alphanumeric characters except spaces
2217+
$cleanedString = preg_replace('/[^A-Za-z0-9\s]/', '', $inputString);
22152218

2219+
// Step 2: Remove specific words
2220+
$unwantedWords = ["php", "htaccess"];
2221+
$resultString = str_replace($unwantedWords, array('',''), $cleanedString);
2222+
2223+
return $resultString;
2224+
}
22162225
?>

0 commit comments

Comments
 (0)