When I run the split() function, I get an array that doesn't go from 0-x but I get mixed up values from 0,2,4,5 ... etc. Here's my script:
$text = "vtk - xtn fac";
$text = str_replace("-", " to ", $text);
$pieces = split('[/.-]|[[:space:]]', $text);
for ($m=0; $m<sizeof($pieces); $m++) {
if (empty($pieces[$m])) {
unset($pieces[$m]);
}
}
print_r($pieces);
My result is: Array ( [0] => vtk [2] => to [4] => xtn [5] => fac )
You see, the order jumps like this: 0,2,4,5. How do I get my array to reset to 0,1,2,3? Thank you all.