+ $j++;
+ }
+
+ /** Find and remove the ones that are deleted */
+ $i = 1;
+ $j = 1;
+ while ($j <= $numMessages) {
+ if ($messages[$j]["FLAG_DELETED"] == true) {
+ $j++;
+ continue;
+ }
+ $msgs[$i]["TIME_STAMP"] = $messages[$j]["TIME_STAMP"];
+ $msgs[$i]["DATE_STRING"] = $messages[$j]["DATE_STRING"];
+ $msgs[$i]["ID"] = $messages[$j]["ID"];
+ $msgs[$i]["FROM"] = $messages[$j]["FROM"];
+ $msgs[$i]["SUBJECT"] = $messages[$j]["SUBJECT"];
+ $msgs[$i]["FLAG_DELETED"] = $messages[$j]["FLAG_DELETED"];
+ $msgs[$i]["FLAG_ANSWERED"] = $messages[$j]["FLAG_ANSWERED"];
+ $msgs[$i]["FLAG_SEEN"] = $messages[$j]["FLAG_SEEN"];
+ $i++;