Verbat Posted February 24, 2008 Share Posted February 24, 2008 If for example i have the word - TEST How can i get only the first 2 letters from it so i will have TE? Same with numbers please. Thanks. Quote Link to comment Share on other sites More sharing options...
toplay Posted February 24, 2008 Share Posted February 24, 2008 See substr() function examples in the manual at http://www.php.net Quote Link to comment Share on other sites More sharing options...
Verbat Posted February 24, 2008 Author Share Posted February 24, 2008 Thanks..... Quote Link to comment Share on other sites More sharing options...
Northern Flame Posted February 24, 2008 Share Posted February 24, 2008 or just do this: <?php $word = "TEST"; echo $word[0]; echo "\n<br>\n"; echo $word[1]; /* $word[0] displays the first character - T $word[1] displays the second character - E */ ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.