would be easier to do if your data was like...
hello,there, here, i, am;what,is,your,name;where,are,you,from
then you would simply
$temp = explode(';',$data); //get sentences as arrays
/*
ie: hello,there,here,i,am
what,is,your,name....
*/
foreach $temp as $line
{
//get each set of comma delimited sentences as $line
$temp2 = explode(',',$temp);
foreach $temp2 as $element
{
// get individual words as $element
$arr[$x][$y] = $element //add each word to a 3d array by numerical indices.
$y++; //increment y indice to store next word
}
$x++; //increment x indice to store next sentence
}
I think taht would work... but you would have to reformat your data... the way you ahve it... wouldnt work well at all from what I can tell....