Get the position of first character in the string
for ( $ i = $ start ; $ i <= $ end ; $ i ++ ) { if ( $ str [ $ i ] >= ' a ' and $ str [ $ i ] <= ' z ' ) { $ firstChar = $ i ; break ; } } return $ firstChar ; }