Home > Backend Development > PHP Tutorial > Convert array encoding

Convert array encoding

WBOY
Release: 2016-07-25 08:50:24
Original
1045 people have browsed it
  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


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template