sub string only show first character in string code example
Example 1: php get first character of string
$firstStringCharacter = substr("hello", 0, 1);
Example 2: javascript get first character of string
var str="Hello Folks!"
var firstStringChar = str.charAt(0); //H