All these things are also true for functions, and are not advantages specific to classes
In my opinion the advantage of OOP is encapsulation, meaning a class is responsible for a bit of data and has method to allow modifying/getting that data, without anyone having to know how the data is represented internally.
That being said, the code the OP posted won’t benefit from this since it doesn’t rely on any state. It could maybe be moved to a static function in a class, but if it’s already a function I’d just leave it.
It could be converted, but this is a very bad candidate, as the code as very procedural in nature. So even though you could convert it to classes it doesn’t make sense here, so won’t really get a grasp on OOP.
I’m thinking it might be more educational to go in the opposite direction. That is, find a simple class that you know works, and then see what would be involved and what limitations there might be rewriting the class as a group of separate functions.
I did not recognise all the functions and thought they were not PHP specific and better suited to a private class functions.
same reason as above.
The function was not taking advantage of any PHP 7 features and could be written as a self contained script with type checking.
As mentioned my knowledge of classes is limited and I do prefer classes because they seem more robust by being encapsulated if that is the correct terminology.
It’s using preg_replace to replace single characters. Regex is significantly slower than str_replace which would be faster and the code would be considerably less confusing to read/write.