I'm not so good at regex..
Looking for a way to trim the end of a string, if the end is:
A space followed by ONE character (can be any character)
Is preg_replace() the thing for that, or is there an easier and faster way?
The trimming will only happen once in the page
For just a space do this. And yes preg_replace is the way to go.
$string = preg_replace('/ .$/', '', $string);
For example:
$foo = 'hello w';
$bar = preg_replace('/\s\S\z/', '', $foo);
(assuming "any character" means "any non-space character"). More on "\" stuff.