The-Last-Escape Posted May 2, 2007 Share Posted May 2, 2007 does anyone know a simple way to limit a string to the first word in it? Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/ Share on other sites More sharing options...
Ninjakreborn Posted May 2, 2007 Share Posted May 2, 2007 re-explain what you need. Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/#findComment-243539 Share on other sites More sharing options...
clown[NOR] Posted May 2, 2007 Share Posted May 2, 2007 maybe try $firstWord = explode(" ", "hello is the first word"); Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/#findComment-243540 Share on other sites More sharing options...
The-Last-Escape Posted May 2, 2007 Author Share Posted May 2, 2007 Ok thanks Clown NOR Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/#findComment-243543 Share on other sites More sharing options...
clown[NOR] Posted May 2, 2007 Share Posted May 2, 2007 no problem.. mark as solved if it answered your question Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/#findComment-243544 Share on other sites More sharing options...
The-Last-Escape Posted May 2, 2007 Author Share Posted May 2, 2007 Done Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/#findComment-243545 Share on other sites More sharing options...
Nameless12 Posted May 2, 2007 Share Posted May 2, 2007 if i remember correctly this is how you select everything before the first white space substr($string, 0, strpos($string, ' ')); Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/#findComment-243622 Share on other sites More sharing options...
The-Last-Escape Posted May 2, 2007 Author Share Posted May 2, 2007 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/49676-solved-truncate/#findComment-243627 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.