I'm making a function which needs to split a varying number of strings.
Well, I'm still not sure if I'm following you, but how about this.
# An array of strings
$strings
# An array to hold these arrays
$the_split=array();
foreach($strings as $string)
{ $the_split[]=split(" ", $string); }
Now I have no idea how or where you are getting each of these strings that need to be parsed (split) so I made an assumption. That assumption being $strings.
So when the loop has completed, you will have one array called $the_split. Each (and this is VERY important to realize) element of that array is an array of each string inserted into it after being run through the split function. So, as I said earlier, you have a multidimensional array. Run a print_r on it to see it's output.
Going on, is $nomvar and array of strings? If so, why not something like...
foreach($nomvar as $var)
{ $the_split[]=split(" ", $var); }
What do you mean by 'crush'?
Anyways, if we knew how you are getting these strings, not to mention WHY you need to split (or explode) them, it would help greatly.
Cheers,
BDKR