array(),
"vcf" => array(),
"contact" => array());
for($i = 0; $i < $count; $i++)
{
$extension = getExtension($_FILES["contacts"]["name"][$i]);
if($extension == "zip")
$files["zip"][] = $i;
elseif($extension == "contact")
$files["contact"] = $i;
elseif($extension == "vcf")
$files["vcf"][] = $i;
}
$contents["contact"] = array();
$contents["vcf"] = array();
foreach($files["contact"] as $contactfile)
{
$contents["contact"][] = file_get_contents($_FILES["contacts"]["tmp_name"][$contactfile]);
}
foreach($files["vcf"] as $contactfile)
{
$contents["vcf"][] = file_get_contents($_FILES["contacts"]["tmp_name"][$contactfile]);
}
foreach($files["zip"] as $zipfile)
{
$zip = new ZipArchive();
$zip->open($_FILES["contacts"]["tmp_name"][$zipfile]);
for ($i = 0; $i < $zip->numFiles; $i++)
{
$extension = getExtension($zip->getNameIndex($i));
if($extension == "contact")
$contents["contact"][] = $zip->getFromIndex($i);
elseif($extension == "vcf")
$contents["vcf"][] = $zip->getFromIndex($i);
}
$zip->close();
}
$images = array();
foreach($contents["contact"] as $contact)
{
$image = array();
$image["name"] = preg_replace('=.*?