Question and answer is powered by AnsPress.io
$myName = "Arpit Singh";
If my PHPvariable value is like the above, I want to get the first later from my string in PHP. How can I display it?
To get the first letter from the string in PHP, apply this code.
<?php $myName = "Arpit Singh"; echo substr($myName, 0, 1); ?>
Output: A