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. Quote Link to comment 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, 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.