Home >Backend Development >PHP Tutorial >Convert array encoding

Convert array encoding

WBOY
WBOYOriginal
2016-07-25 08:50:241047browse
  1. function array_iconv($in_charset,$out_charset,$arr){
  2. return eval('return '.iconv($in_charset,$out_charset,var_export($arr,true).';'));
  3. }
  4. echo json_encode(array_iconv('GBK','UTF-8',array("title"=>"Three-day tour from Shanghai to Qingdao","price"=>3000)));
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Calculate zodiac signsNext article:Calculate zodiac signs