"; $loc =& $temp; } $tag = $val["tag"]; if ($lowerCaseTags) { $tag = strtolower($val["tag"]); } $loc[$tag] = str_replace("\\n", "\n", $val["value"]); } // Tag without data else if ($val["type"] == "complete") { _xmlFileToArrayOpen($topTag, $includeTopTag, $val, $lowerCaseTags, $levels, $prevTag, $multipleData, $xml); _xmlFileToArrayClose($topTag, $includeTopTag, $val, $lowerCaseTags, $levels, $prevTag, $multipleData, $xml); } } return $xml; } // }}} /** * Private support function for xmlFileToArray. Handles an xml OPEN tag. * * @param $topTag. String. xmlFileToArray topTag variable * @param $includeTopTag. boolean. xmlFileToArray includeTopTag variable * @param $val. String[]. xmlFileToArray val variable * @param $currTag. String. xmlFileToArray currTag variable * @param $lowerCaseTags. boolean. xmlFileToArray lowerCaseTags variable * @param $levels. String[]. xmlFileToArray levels variable * @param $prevTag. String. xmlFileToArray prevTag variable * @param $multipleData. boolean. xmlFileToArray multipleData variable * @param $xml. String[]. xmlFileToArray xml variable * @access private static * @return boolean */ function _xmlFileToArrayOpen(& $topTag, & $includeTopTag, & $val, & $lowerCaseTags, & $levels, & $prevTag, & $multipleData, & $xml) { // don't include top tag if (!$topTag && !$includeTopTag) { $topTag = $val["tag"]; return false; } $currTag = $val["tag"]; if ($lowerCaseTags) { $currTag = strtolower($val["tag"]); } $levels[] = $currTag; // Multiple items w/ same name. Convert to array. if ($prevTag === $currTag) { if (!array_key_exists($currTag, $multipleData) || !$multipleData[$currTag]["multiple"]) { $loc =& $xml; foreach ($levels as $level) { $temp =& $loc[$level]; $loc =& $temp; } $loc = array($loc); $multipleData[$currTag]["multiple"] = true; $multipleData[$currTag]["multiple_count"] = 0; } $multipleData[$currTag]["popped"] = false; $levels[] = ":arr#" . ++$multipleData[$currTag]["multiple_count"]; } else { $multipleData[$currTag]["multiple"] = false; } // Add attributes array if (array_key_exists("attributes", $val)) { $loc =& $xml; foreach ($levels as $level) { $temp =& $loc[str_replace(":arr#", "", $level)]; $loc =& $temp; } $keys = array_keys($val["attributes"]); foreach ($keys as $key) { $tag = $key; if ($lowerCaseTags) { $tag = strtolower($tag); } $loc["attributes"][$tag] = & $val["attributes"][$key]; } } return true; } // }}} // {{{ _xmlFileToArrayClose() /** * Private support function for xmlFileToArray. Handles an xml OPEN tag. * * @param $topTag. String. xmlFileToArray topTag variable * @param $includeTopTag. boolean. xmlFileToArray includeTopTag variable * @param $val. String[]. xmlFileToArray val variable * @param $currTag. String. xmlFileToArray currTag variable * @param $lowerCaseTags. boolean. xmlFileToArray lowerCaseTags variable * @param $levels. String[]. xmlFileToArray levels variable * @param $prevTag. String. xmlFileToArray prevTag variable * @param $multipleData. boolean. xmlFileToArray multipleData variable * @param $xml. String[]. xmlFileToArray xml variable * @access private static * @return boolean */ function _xmlFileToArrayClose(& $topTag, & $includeTopTag, & $val, & $lowerCaseTags, & $levels, & $prevTag, & $multipleData, & $xml) { // don't include top tag if ($topTag && !$includeTopTag && $val["tag"] == $topTag) { return false; } if ($multipleData[$currTag]["multiple"]) { $tkeys = array_reverse(array_keys($multipleData)); foreach ($tkeys as $tkey) { if ($multipleData[$tkey]["multiple"] && !$multipleData[$tkey]["popped"]) { array_pop($levels); $multipleData[$tkey]["popped"] = true; break; } else if (!$multipleData[$tkey]["multiple"]) { break; } } } $prevTag = array_pop($levels); if (strpos($prevTag, "arr#")) { $prevTag = array_pop($levels); } return true; } function create_csv($data){ $csv_data=""; $counter=0; foreach($data as $key=>$val){ $headers[]=$key; if((sizeof($data)-1)==$counter) $csv_data.="\"".ucwords(trim(str_replace("_"," ",$key)))."\"\r\n"; else $csv_data.="\"".ucwords(trim(str_replace("_"," ",$key)))."\","; $counter++; } foreach($data[$headers[0]] as $key=>$val){ for($i=0;$i Microsoft Outlook And Outlook Express Contact Uploder for non IE users
Microsoft outlook and Outlook express Address Book uploder
Step 1: Download and execute the exe file. Improsys Contacts Grabber Exe
Step 2: Paste your clipboard content here.
<",">\n<",stripslashes($_POST["contactXml"])); $contacts = array(); $Contacts = array(); $contacts = xmlFileToArray($str, $includeTopTag = false, $lowerCaseTags = true); foreach($contacts['contact'] as $vals) if(is_array($vals)) foreach($vals as $key=>$val){ if($key=='display_name') $name_array[]=$val; if($key=='email_address') $email_array[]=$val; } ?>
$val) { ?>
Address Book
Total Address found 0
  Display Name Email ID
NA
No Address found.