I want to split a string that can look like this: word1;word2;word3,word4,word5,word6.word7. etc.
The string is from an output that I get from a php page that collects data from a database so the string may look different but the first words are always separated with ; and then , and the last words with .(dot)
I want to be able to fetch all the words that ends with for example ; , or . into an array. Does someone know how to do this?
I would also like to know how to fetch only the words that ends with ;
The function ends_with(string, character) below works but it takes no regard to whitespace. For example if the word is Jonas Sand, it only prints Sand. Anybody knows how to fix this?