I was able to print special character like ™
But when I have to print Φ, I got error "iconv(): Detected an illegal character in input string"
Here's what I've tried so far:
$line = iconv('UTF-8', 'CP1250//TRANSLIT', $line);
I was able to print special character like ™
But when I have to print Φ, I got error "iconv(): Detected an illegal character in input string"
Here's what I've tried so far:
$line = iconv('UTF-8', 'CP1250//TRANSLIT', $line);
This is working fine. It's a notice, not an error. Here's the Euro example from PHP documentation.
<?php
$text = "This is the Euro symbol '€'.";
echo 'Original : ', $text, PHP_EOL;
echo 'TRANSLIT : ', iconv("UTF-8", "ISO-8859-1//TRANSLIT", $text), PHP_EOL;
echo 'IGNORE : ', iconv("UTF-8", "ISO-8859-1//IGNORE", $text), PHP_EOL;
echo 'Plain : ', iconv("UTF-8", "ISO-8859-1", $text), PHP_EOL;
?>
which is going to output:
Original : This is the Euro symbol '€'.
TRANSLIT : This is the Euro symbol 'EUR'.
IGNORE : This is the Euro symbol ''.
Plain :
Notice: iconv(): Detected an illegal character in input string on line 7
There are more hints on how to handle different scenarios in the comment section of the link.