Apparently there\'s no mb_trim in the mb_* family, so I\'m trying to implement one for my own.
I recently found this regex in a comment in php.net:
This version supports the second optional parameter $charlist:
function mb_trim ($string, $charlist = null)
{
if (is_null($charlist)) {
return trim ($string);
}
$charlist = str_replace ('/', '\/', preg_quote ($charlist));
return preg_replace ("/(^[$charlist]+)|([$charlist]+$)/us", '', $string);
}
Does not support ".." for ranges though.