cs.punk Posted June 23, 2009 Share Posted June 23, 2009 Ok, I am trying to read a message from a user. It should contain the string "My name is Example", example being the name. Should I use the function 'eregi' and somehow 'number' all the words in the string, after than do something?... Anyone know the functions I could use? Quote Link to comment https://forums.phpfreaks.com/topic/163428-find-my-name-is-and-extract-the-word-after-that-string-help/ Share on other sites More sharing options...
Alex Posted June 23, 2009 Share Posted June 23, 2009 Would that be the exact string? More specifically: Would it contain anything after it? How about before? Quote Link to comment https://forums.phpfreaks.com/topic/163428-find-my-name-is-and-extract-the-word-after-that-string-help/#findComment-862268 Share on other sites More sharing options...
cs.punk Posted June 23, 2009 Author Share Posted June 23, 2009 Would that be the exact string? More specifically: Would it contain anything after it? How about before? No it will not be the complete string. I would like to 'search' the entire message for 'my name is'. Quote Link to comment https://forums.phpfreaks.com/topic/163428-find-my-name-is-and-extract-the-word-after-that-string-help/#findComment-862272 Share on other sites More sharing options...
cs.punk Posted June 24, 2009 Author Share Posted June 24, 2009 Ok anyone know of a function that puts each word into a ARRAY? That way I could make a LOOP and test each word IF it matches, IF it does, see IF the next word matches? Quote Link to comment https://forums.phpfreaks.com/topic/163428-find-my-name-is-and-extract-the-word-after-that-string-help/#findComment-862562 Share on other sites More sharing options...
patrickmvi Posted June 24, 2009 Share Posted June 24, 2009 You could always do an explode on it using a space (" ") and then go through all of the entities but you'd have to filter out punctuation. Quote Link to comment https://forums.phpfreaks.com/topic/163428-find-my-name-is-and-extract-the-word-after-that-string-help/#findComment-862568 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.