PHP SPLIT
Posted by chaabant on Jan 4, 2009
hi..can anyone please solve my problem?
i have text input and a submit button.
The user will insert sentence/question/any text in the text input.Then, when he/she press the submit
button, the input will be keep in the database(mysql). After that, i want to split the input(let say a sentence) into words(array).
Here is an example:
Input: Differentiate between array and arraylist.
After splitting:
=>Differentiate
=>between
=>array
=>and
=>arraylist
=>.
I wonder how mysql handle the input after splitting it?is it in a field or each index of array(each word) in the difference field?because after splitting it, i want to match the input(which is now in form of words not a sentence) with a library i made in mysql.
Let say, in my library there are 3 fields:weight1,weight2,weight3.The word ‘what’ was in field weight1 in my
library.
So, the question is: how can i split the input into words and then match it with my library so that i can state the input is in which weight(weight1/weight2/weight3).
Please help me.
Thank you.