almightyegg Posted October 24, 2007 Share Posted October 24, 2007 I have a bit of code that selects the first 5 words of a variable: $short = join(' ', array_slice (explode(' ', $posmes['message']), 0, 5)); Works great, butI want it to select the first 30 Characters instead...How do I change it from words to characters?? Quote Link to comment https://forums.phpfreaks.com/topic/74592-solved-problm-select-first-parts-of-variable/ Share on other sites More sharing options...
Wuhtzu Posted October 24, 2007 Share Posted October 24, 2007 http://dk2.php.net/substr Quote Link to comment https://forums.phpfreaks.com/topic/74592-solved-problm-select-first-parts-of-variable/#findComment-377018 Share on other sites More sharing options...
almightyegg Posted October 24, 2007 Author Share Posted October 24, 2007 thanks thaworked a treat Quote Link to comment https://forums.phpfreaks.com/topic/74592-solved-problm-select-first-parts-of-variable/#findComment-377055 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.