Hello I'm creating a "fun-translator", and I'm trying to add a word to the end of every third sentence or so.
It gets another page HTML code and translate it into teen language. But I want to add a word to every third sentence. I've been using this line for now:
$str = preg_replace_callback('{<.*?[^>]*>([æøåÆØÅ !,\w\d\-\(\)]+)([<|\s|!|\.|:])</.*?>}',
"assIt", $str);
But it does only add the word when the sentence is surrounded by HTML code.
I thougt that I could find every sentence by checking for a big letter and then find a puncation, but I really don't know regular expression to well.
Anyone knows how I can get it to work?