Hi everyon,
Here is my text file :
My output shows either gibrish or errors as shown in the attachment
Any advise how to get rid of gibrish from my text file?
Thanks
Here is my text file :
Here is my code:100055,䪰䬬054-4889012,,, (south),并쬲8,78390,,,erans@hotmail,
102958,,-6418346,052-3964300,,⡸ (south),⪺-35/2,84812,,,amiliv@hotmail,
Code:
<?php
$myText = 'test_gibrish.txt';
$myHandle = fopen($myText,'r');
$myRead = fread($myHandle, filesize($myText));
$enc = mb_detect_encoding($myRead, "UTF-8,ISO-8859-1");
$textArr = explode(',',$myRead);
$str = $textArr[15];
echo $str."<br>";
echo iconv($enc, "ISO-8859-1", $str)."<br />";
echo iconv($enc, "utf-8", $str)."<br />";
echo iconv($enc, "utf-8", $str)."<br />";
echo iconv($enc, "ISO-8859-1//TRANSLIT", $str), PHP_EOL;
echo iconv($enc, "ISO-8859-1//IGNORE", $str), PHP_EOL;
echo iconv($enc, "ISO-8859-1", $str), PHP_EOL;
echo $str.'<br>';
?>
Any advise how to get rid of gibrish from my text file?
Thanks