Home > Backend Development > PHP Tutorial > php json Chinese character escape

php json Chinese character escape

WBOY
Release: 2016-07-29 08:56:14
Original
1198 people have browsed it

<code><span>$test0</span>=<span>array</span>(
    <span>'id'</span>=><span>100</span>,
    <span>'name'</span>=><span>"demo数据"</span>,
    );

<span>//将数组遍历,每个变量进行编码</span><span>foreach</span>(<span>$test0</span><span>as</span><span>$key</span>=><span>$val</span>){
  <span>$test</span>[<span>$key</span>]=urlencode(<span>$val</span>);
 }

 <span>$test2</span>=json_encode(<span>$test</span>);
 <span>$test3</span>=urldecode(<span>$test2</span>);
 <span>echo</span><span>$test3</span>;</code>
Copy after login
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

The above introduces the php json Chinese character escaping, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

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