magnetica Posted February 26, 2007 Share Posted February 26, 2007 Anyone know the function that can get the first letter of word or words. E.g. apple = a football game - f etc... Link to comment https://forums.phpfreaks.com/topic/40223-simple-function-to-find-first-letter-of-a-word-or-phrase/ Share on other sites More sharing options...
magnetica Posted February 26, 2007 Author Share Posted February 26, 2007 Dont worry I will answer my own question LOL Its '$letter%' Link to comment https://forums.phpfreaks.com/topic/40223-simple-function-to-find-first-letter-of-a-word-or-phrase/#findComment-194623 Share on other sites More sharing options...
Orio Posted February 26, 2007 Share Posted February 26, 2007 <?php //$string holds some sort of string echo $string[0]; //Echo the first character in the string //Another option: echo substr($string, 0, 1); //Does the same thing ?> Orio. Link to comment https://forums.phpfreaks.com/topic/40223-simple-function-to-find-first-letter-of-a-word-or-phrase/#findComment-194625 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.