Hi guys,

I'm working on a project and wanted to know if there is a good / trusted way to break a string apart into words. I want to get all the words in a string that will be used in a mysql query.

I tested with str_word_count but it breaks up the string into characters like (a, b) if there are no words in the string.

Thanks in advance.

2 Years
Discussion Span
Last Post by navichawla92

Hi Rudy,

I tried using split & explode but you have to have a delimiter (" ", | ",", | "+", | ".",) and I want the splitting to be more dynamic with out me using delimiters.

Let say I have a string (This isa string + that_needs to be, split.into words), do do the splitting here will be a nightmare and I want something that will be more dynamic.

Not sure if it make's sense what I'm asking?

I'm pulling data from a database table then I want to break the data up into words / varalbes and then re-use those in the next MySQL query for a more refined search.


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.