Home  >  Article  >  Backend Development  >  Is there a function in php that can quickly convert object or arr into json string?

Is there a function in php that can quickly convert object or arr into json string?

WBOY
WBOYOriginal
2016-12-01 00:56:481264browse

Is there a function in php that can quickly convert object or arr into json string?

Reply content:

Is there a function in php that can quickly convert object or arr into json string?

Hey, if you don’t know enough, you should read more books. json_encode

json_encode

<code>(object) $arr;
(array) $obj;
json_encode($arr);
json_decode($json);</code>

json_decode json_encode.....

You can use a third-party library, search on Baidu, there will be a lot of them

If you are using mac system. It is recommended that you install Dash for easy viewing of various technical documents. I have collected an article introducing mac tools. http://go2live.cn/archives/13...

json_encode json_decode
Look at the PHP manual yourself. . .

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