I’ve been racking my brain and scavenging the internet for over an hour now…
Im looking for a function in PHP simular to “trim” but one that removes any character except those in a given list, for example;
$niceChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_+";
$rawString = "myString";
$happyString = removeNastyNess($rawString, $niceChars);
Does any such function exist?
Without reg exp: