Using explode() function is so simple.
for example,
in case of your source,
your data file is following,
contents of data : a bcd fg b
to parse this data, you just write like following this,
$fp = fopen ($file,"r");
$line = fgets($fp, 1000);
$arr = explode(" ", $line);
to print this, write like following this,
while(list($key,$val) = each($arr)) {
echo("\$arr[$key] : $val<br>");
}
contents of print :
$arr[0] : a
$arr[1] : bcd
$arr[2] : fg
$arr[3] : b
in order to change delimeter(,) in this case,
you just change parameter of explode like this,
$arr = explode(",", $line);
your job is just to change $arr[] values to $new[][].
I hope you will have a good result.
bye.