PHP: Dealing special characters with iconv

后端 未结 2 1524
温柔的废话
温柔的废话 2020-12-09 02:18

I still don\'t understand how iconv works.

For instance,

$string = \"Löic & René\";
$output = iconv(\"UTF-8\", \"ISO-8859-1//TRANSL         


        
相关标签:
2条回答
  • 2020-12-09 02:51

    And did you save your source file in UTF-8 encoding? If not (and I guess you didn't since that will produce the "incomplete multibyte character" error), then try that first.

    0 讨论(0)
  • 2020-12-09 02:59
    $clean = iconv('UTF-8', 'ASCII//TRANSLIT', utf8_encode($s));
    
    0 讨论(0)
提交回复
热议问题