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? 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? 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'. 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? 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. 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
Archived
This topic is now archived and is closed to further replies.