I want to get the first letter of a string and I\'ve noticed that $str[0] works great. I am just not sure whether this is \'good practice\', as that notation is
$str[0]
In case of multibyte (unicode) strings using str[0] can cause a trouble. mb_substr() is a better solution. For example:
str[0]
mb_substr()
$first_char = mb_substr($title, 0, 1);
Some details here: Get first character of UTF-8 string