php - Wordstrip function skipping words for no apparent reason. -
Tonight I realized that the stringing functions I'm using are randomly leaving the words.
? & Gt;
This word is "The" skipping and I do not have any clue why this list is something like 200 words and I know its work because it exits from other words. >
I gave it a message to the last letter "One George W. Bush and Dick Cheney"
I think the reason "/ \ s" is since the beginning of "the" string And "the last letter for George W. Bush and Dick Cheney from one last legend". I tried "/ \ s?" But this did not work. I think I need to make the vacant space right?
Thank you
To represent you a word boundary, \ B and can not be spaced with spaces or periods or anything else: $ document = strtolower ($ document); Foreign currency ($ wordlist $ word) $ document = preg_replace ("/ \ b". $ Word. "\ B /", "", $ document); $ Nopunc = preg_replace ('/ [^ a-z0- 9] + / i', '', $ document); $ Trimmed = trim ($ nopunc); Return $ deduction;
Comments
Post a Comment