json_decode和json_encode的區別


1.json_decode() 

json_decode 
(PHP 5 >= 5.2.0, PECL json >= 1.2.0) 

json_decode — 對 JSON 格式的字符串進行編碼 

說明 
mixed json_decode ( string $json [, bool $assoc ] ) 
接受一個 JSON 格式的字符串並且把它轉換為 PHP 變量 

2.json_encode() 

json_encode 
(PHP 5 >= 5.2.0, PECL json >= 1.2.0) 

json_encode — 對變量進行 JSON 編碼 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM