I have a csv file in this format:
004AA744D82D64CA86257753007134CF
"","10/06/2010 01:10:30 PM","Created Payment Receipt","","",""
"","10/06/2010 01:10:26 PM","$ Fee Payment Recorded","","",""
"","09/28/2010 04:47:08 PM","Created Email to Client","","",""
008077543BBBCF588625770300748FE0
"","09/24/2010 04:11:58 PM","Created Letter - Appearance Letter","","",""
"","08/30/2010 01:14:52 PM","Created Payment Recept","","",""
Where hex value is the ID for the lines that follow. When a new hex value appears, it serves as the ID for the next few lines, etc.
I am having trouble getting the hex value to be constant until the next value is reached.
I have tried the following, and I know why it doesn't work, I am just too new to php to know where to go from here.
while (($data = fgetcsv($handle, 0, ',', '"'))) {
$hexID = clean($data[0]);
if (empty($data[0])){
$hexID = $hexID;
}
if (empty($data[1])){
$date = '';
}else{
$tmpdate = clean($data[1]);
$exp = explode(' ', $tmpdate);
$time = $exp[1];
$expdate = explode ('/', $exp[0]);
$glued = $expdate[2].'-'.$expdate[0].'-'.$expdate[1];
$date = $glued.' '.$time;
}
if (empty($data[2])){
$text = '';
$text = $data[2];
}
*edited for grammar