i have the sentence
something about something WORD still something...
what is the most efficient metod to delete the word “WORD” from sentence in php?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could replace it with nothing:
Although that would also ruin words like
swordfish, turning them intosfish. So you could put spaces around the edges:But then it won’t match words at the end and beginning of sentences. So you might have to use a regex:
The
\bis a word boundary, which could be a space or a beginning of a string or anything like that.