How do i get the first character of a string in php?
I need to get the first character of the given string. here i have a name in the session variable. i am passing the variable value to the Show i want to get the first character of that string. for example John doe. i want to get the first
character of the string
asked Nov 24, 2015 at 10:11
4 For the single-byte encoded (binary) strings:
For the multi-byte encoded strings, such as UTF-8:
answered Nov 24, 2015 at 10:14
1 Three Solutions Sorted by Robustness1. mb_substrIt takes into consideration text encoding. Example:
2. |