Apparently there\'s no mb_trim in the mb_* family, so I\'m trying to implement one for my own.
mb_trim
I recently found this regex in a comment in php.net:
I don't know what you're trying to do with that endless recursive function you're defining, but if you just want a multibyte-safe trim, this will work.
function mb_trim($str) { return preg_replace("/^\s+|\s+$/u", "", $str); }