get first letter of a string - Php

first letter of str

Snippet Code


  
Rate this page :
  [ 0 votes]

to obtain first letter if a string, use the following:

if you have the string in a variable like, $str = "Hscripts"; just echo $str[0]; it will return the first letter of the string

Tags


Ask Questions

Ask Question