最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
PHP+JQUERY操作JSON实例
时间:2022-06-24 14:44:13 编辑:袖梨 来源:一聚教程网
json.html 代码:
| 代码如下 | 复制代码 |
|
$(function(){ $("#submit").click(function(){ vartext = $("input").serialize(); $.ajax({ 'type':"POST", 'url':'json_encode.php', 'dataType':'json', 'data':text, success:insertData }); }); }); functioninsertData(data){ varstr ="姓名="+data.name+" $("#view").html(str); } 姓名: 性别: 年龄: |
|
json_encode.php 代码
| 代码如下 | 复制代码 |
|
header("Content-type:text/html;charset=utf8"); include("Json.php"); $name=$_POST['name']; $sex=$_POST['sex']; $age=$_POST['age']; $json_arg=array('name'=>$name,'sex'=>$sex,'age'=>$age); $json=newJSON; $json_result=$json->encode($json_arg); echo$json_result; ?> |
|
相关文章
- 基于Ollama本地搭建OpenClaw私人助手的实现方式步骤实用指南 10-03
- starwave:AI Agent 工具实践指南 10-03
- Paper2Seminar:AI Agent 工具实践指南 10-03
- PromptSkill4image:实践指南 10-03
- pishi-normalno:AI Agent 工具实践指南 10-03
- contract-review:实践指南 10-03