if you want a quick fix go buy
"learn PHP in ten minutes" and spend
the next twenty years googling for
"how do I compute the length of a string"
Doing multibyte string handling properly in PHP is way harder than it should have been.