php 简单的web get 请求处理
2016-02-02 15:03
645 查看
$output = array(); $a = @$_GET['useid'] ? $_GET['useid'] : ''; //$uid = @$_GET['uid'] ? $_GET['uid'] : 0; if (empty($a)) { // $output = array('data'=>NULL, 'info'=>'ios!', 'code'=>-201); $output = array('hahah'=>'hello', 'requestDic'=>'hello','hello'=>array('image'=>'www.baidu.com','imageurl'=>'www.baidu.com')); exit(json_encode($output)); }elseif(!empty($a)){ $output = array('hahah'=>'hello', 'requestDic'=>'hello','hello'=>array('image'=>'www.sina.com','imageurl'=>'www.sina.com')); exit(json_encode($output)); };
相关文章推荐
- ThinkPHP3.2切换数据库调用
- PHP大批量插入数据库的3种方法和速度对比
- php HTML安全过滤
- 史上最全然oophper php文件上传之文件类型相应表,ie,火狐各一份。
- php爬虫框架crawler
- PHP中htmlentities和 htmlspecialchars区别
- php资料整理
- php写webservice接口
- FEC ADMIN : Yii2 扩展 DWZ UI 整合 - composer 安装 - 账户管理,菜单管理,权限管理,日志缓存管理
- phalcon-入门篇3(优美的URL与Config)
- 正则表达式
- PHP->iNews新闻发布系统目录结构2
- An error occurred while collecting items to be installed session context was:(profile=DefaultProfile... 解决方案
- win7 iis 配置PHP5.3.27实践记录
- PHP学习(4)——数据类型
- PHP学习(4)——数据类型
- php面向对象(二),继承,重写,parent,final关键字及访问控制
- PHP->iNews新闻发布系统目录结构1
- 必须收藏的23个php实用代码片段
- 纠结的NTP安装过程