56 of 110 menu

The First Character of a String in PHP

Ready example of getting the first character of a string:

<?php $str = 'text'; echo $str[0]; ?>

Code execution result:

't'
English
БеларускаяEspañolРусский
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline