I want to encode Chinese to \\u5de5\\u4f5c formate in php. -


i want encode chinese \u5de5\u4f5c formate in php. there builtin php function or method ?

the function json_encode() can used escape utf-8 encoded strings unicode format.

example:

<?php     echo json_encode('工作'); 

output:

"\u5de5\u4f5c" 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -