Heim > Artikel > Backend-Entwicklung > php json中文字符转义
<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>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });
以上就介绍了php json中文字符转义,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。