|
|
@ -63,13 +63,13 @@ foreach($lines as $line){ |
|
|
|
if(strtoupper(trim($line)) == 'BEGIN:VCARD'){ |
|
|
|
if(strtoupper(trim($line)) == 'BEGIN:VCARD'){ |
|
|
|
$inelement = true; |
|
|
|
$inelement = true; |
|
|
|
} elseif (strtoupper(trim($line)) == 'END:VCARD') { |
|
|
|
} elseif (strtoupper(trim($line)) == 'END:VCARD') { |
|
|
|
$card[] = iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line); |
|
|
|
$card[] = str_replace('=0D=0A', '\n', iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line)); |
|
|
|
$parts[] = implode($nl, $card); |
|
|
|
$parts[] = implode($nl, $card); |
|
|
|
$card = array(); |
|
|
|
$card = array(); |
|
|
|
$inelement = false; |
|
|
|
$inelement = false; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($inelement === true && trim($line) != '') { |
|
|
|
if ($inelement === true && trim($line) != '') { |
|
|
|
$card[] = iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line); |
|
|
|
$card[] = str_replace('=0D=0A', '\n', iconv(mb_detect_encoding($line, 'UTF-8, ISO-8859-1'), 'utf-8', $line)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//import the contacts |
|
|
|
//import the contacts |
|
|
|