Blogger Information
Blog 32
fans 0
comment 0
visits 23763
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
JSON总结-2019年5月17日20点00分
小李广花荣
Original
660 people have browsed it

JSON :

             1.前端将数据传到后台时:可以将数据转换成 JSON对象         然后在将JSON对象换成JSON字符串加上KEY 

               var obj={ name:user.name,password:user.password}    var data='user='+JSON.stirngify('obj');

            2.后端获取前端数据  然后将数据转换成PHP数组或对象要用到 json_decode();

               $user=$_POST['user'];

                $arr=json_decode($user,assoc:true);

                 $user=$arr['user'];

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post