首页 > 后端开发 > php教程 > php 简单的web get 请求处理

php 简单的web get 请求处理

WBOY
发布: 2016-07-29 09:04:18
原创
1048 人浏览过
<span><span>$output</span><span>= </span><span>array</span><span>();
</span><span>$a </span><span>= @</span><span>$_GET</span><span>[</span><span>'useid'</span><span>] ? </span><span>$_GET</span><span>[</span><span>'useid'</span><span>] : </span><span>''</span><span>;
</span><span><em>//$uid = @$_GET['uid'] ? $_GET['uid'] : 0;
</em></span><span><em></em></span><span>if </span><span>(</span><span>empty</span><span>(</span><span>$a</span><span>)) {
</span><span><em>// $output = array('data'=>NULL, 'info'=>'ios!', 'code'=>-201);
</em></span><span><em></em></span><span>$output</span><span>= </span><span>array</span><span>(</span><span>'hahah'</span><span>=></span><span>'hello'</span><span>,
</span><span>'requestDic'</span><span>=></span><span>'hello'</span><span>,</span><span>'hello'</span><span>=></span><span>array</span><span>(</span><span>'image'</span><span>=></span><span>'www.baidu.com'</span><span>,</span><span>'imageurl'</span><span>=></span><span>'www.baidu.com'</span><span>));
</span><span>exit</span><span>(json_encode(</span><span>$output</span><span>));
</span><span> }</span><span>elseif</span><span>(!</span><span>empty</span><span>(</span><span>$a</span><span>)){
</span><span>$output</span><span>= </span><span>array</span><span>(</span><span>'hahah'</span><span>=></span><span>'hello'</span><span>,
</span><span>'requestDic'</span><span>=></span><span>'hello'</span><span>,</span><span>'hello'</span><span>=></span><span>array</span><span>(</span><span>'image'</span><span>=></span><span>'www.sina.com'</span><span>,</span><span>'imageurl'</span><span>=></span><span>'www.sina.com'</span><span>));
</span><span>exit</span><span>(json_encode(</span><span>$output</span><span>));
</span><span> };</span></span>
登录后复制

以上就介绍了php 简单的web get 请求处理,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板