StirCrazy Posted March 10, 2008 Share Posted March 10, 2008 Hi there, I've used stripos to find the position of part a word. How would I find the full word? EXAMPLE: $string = "this is message text text text text text text text text text text text"; the full word at character position 10 is "message". How word I put that full word ("message") in a variable (for use later)? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/95506-find-word/ Share on other sites More sharing options...
uniflare Posted March 10, 2008 Share Posted March 10, 2008 you would use substr(), and maybe str_split() ... eg: $word = substr($string,strpos("mess")); $word_arr = str_split(" ",$word); $word = $word_arr[0]; perhaps, Link to comment https://forums.phpfreaks.com/topic/95506-find-word/#findComment-488894 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.