fraser5002 Posted January 10, 2011 Share Posted January 10, 2011 Hi i i need to be able to get the 4 lettter soundex value for each for in a string and combine them rather than having one 4 letter soundex code for the entire string . How would i do this? Link to comment https://forums.phpfreaks.com/topic/224020-soundex-help/ Share on other sites More sharing options...
mikecampbell Posted January 10, 2011 Share Posted January 10, 2011 You need to get the 4 letter soundex for each what in a string? How do intend to "combine" soundexes? Do you want to get an array of soundexes for each word in a string? Link to comment https://forums.phpfreaks.com/topic/224020-soundex-help/#findComment-1157674 Share on other sites More sharing options...
fraser5002 Posted January 11, 2011 Author Share Posted January 11, 2011 Hi Indeed that is what i am asking, i want the soundex for each word within the string which i will then cat together to form one new string of soundex values. What i dont understand is how to split up the string to its component words and take the soundex of each. Link to comment https://forums.phpfreaks.com/topic/224020-soundex-help/#findComment-1157784 Share on other sites More sharing options...
mikecampbell Posted January 11, 2011 Share Posted January 11, 2011 PHP has a built-in soundex() function. You can split text into words using something like this: $words = preg_split('/[^a-z]+/', strtolower($text)); Link to comment https://forums.phpfreaks.com/topic/224020-soundex-help/#findComment-1157820 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.