查找了数据库,再在while里拼接成json是很麻烦的,所以,jump display

获得数组

<?php

header("Content-Type:text/html; charset=utf-8");

/*json接口测试*/
$g=$_GET['g'];
$v=$_GET['v'];
$msu=$_GET['msu'];
print_r ($g);
print_r ($v);
print_r ($msu);
/*json*接口测试*/ //进行my数据库连接
$con = mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
} mysql_query("set names utf8");//ut8声明
mysql_select_db("examples", $con);//打开my里的数据库 //显示my里的用户数据以便于添加参照
$my = mysql_query("SELECT name FROM `think_form` WHERE city = '上海' AND groupName = '专家'"); echo "[";
while($a=mysql_fetch_array($my))
{
echo json_encode($a['name']).",";
}
echo "]"; ?>

再次修改显示内容,还可以做个伪接口

<?php
//get传值
header("Content-Type:text/html; charset=utf-8");
$g=$_GET['g'];
$urlg = "http://localhost/a.php?g=".$g ;
$contentsg = file_get_contents($urlg);
//如果出现中文乱码使用下面代码
//$getcontent = iconv("gb2312", "utf-8",$contentsg);
echo preg_replace('(,])',']',$contentsg);//preg_replace(find,被替换成,字符串)
echo "<br>";
?>

接口本来要传很多的参数,但是天晚了,想的费功夫,多写几个伪接口页面就得了。。。

jump display的更多相关文章

  1. 设备管理 USB ID

    发现个USB ID站点,对于做设备管理识别的小伙伴特别实用 http://www.linux-usb.org/usb.ids 附录: # # List of USB ID's # # Maintain ...

  2. TRichTextBox – A universal RichTextBox which can display animated images and more

    TRichTextBox – A universal RichTextBox which can display animated images and more trestan, 7 Dec 201 ...

  3. I.MX6 U-boot lvds display hacking

    /*********************************************************************************** * I.MX6 U-boot ...

  4. CSS HTML元素布局及Display属性

    本篇文章主要介绍HTML的内联元素.块级元素的分类与布局,以及dispaly属性对布局的影响. 目录 1. HTML 元素分类:介绍内联元素.块级元素的分类. 2. HTML 元素布局:介绍内联元素. ...

  5. 从display:run-in;中学习新技能

    有时我们想在一行内显示一个标题,以及一段内容,虽然看起来比较简单,但是为了语义化用dl比较合适,但是它默认是block元素,改成inline?那么有多段呢?不就都跑上来了?用float?那问题也挺多. ...

  6. [转]thinkphp 模板显示display和assign的用法

    thinkphp 模板显示display和assign的用法 $this->assign('name',$value); //在 Action 类里面使用 assign 方法对模板变量赋值,无论 ...

  7. [LeetCode] Frog Jump 青蛙过河

    A frog is crossing a river. The river is divided into x units and at each unit there may or may not ...

  8. [LeetCode] Jump Game 跳跃游戏

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

  9. [LeetCode] Jump Game II 跳跃游戏之二

    Given an array of non-negative integers, you are initially positioned at the first index of the arra ...

随机推荐

  1. HDU 5092 DP

    DP水题 求从上到下走完,使所取得权值最小,并输出路径,若有多个满足,则输出靠右的 #include "stdio.h" #include "string.h" ...

  2. Openresty增加waf配置

    Openresty增加waf配置 1. Ngx lua waf 说明 防止sql注入,本地包含,部分溢出,fuzzing测试,xss,SSRF等web攻击 防止svn/备份之类文件泄漏 防止Apach ...

  3. Android开发16——获取网络资源之基础应用

    一.项目背景在Android开发中有一项非常广泛的应用:Android项目获取另一个web项目的资源或者返回的数据.本博文介绍了获取另一个web项目的资源.有一个web项目,在其WebRoot文件夹下 ...

  4. JAX-RS(REST Web Services)2.0 can not be installed: One or more constraints have not been satisfied

    eclipse出错: JAX-RS(REST Web Services)2.0 can not be installed: One or more constraints have not been ...

  5. [na]出口选路pbr小实验视频

    什么是策略路由? 一般都是部署在出口路由器,用于路径强制分发的, 优先级高于路由表. 策略路由小实验视频 这个是读书时候录的一个策略路由小实验

  6. Progressive Web App

    下一代 Web 应用? 近年来,Web 应用在整个软件与互联网行业承载的责任越来越重,软件复杂度和维护成本越来越高,Web 技术,尤其是 Web 客户端技术,迎来了爆发式的发展. 包括但不限于基于 N ...

  7. removeChildByTag、schedule、schedule_selector

    Test4::Test4() { CCSprite *sp1 = CCSprite::create(s_pPathSister1); CCSprite *sp2 = CCSprite::create( ...

  8. 每日英语:The Biggest Distraction In The Office Is Sitting Next To You

    The big push in office design is forcing co-workers to interact more. Cubicle walls are lower, offic ...

  9. ReportNG测试报告的定制修改(二)

    上一篇文章修改了一些基本的ReportNG信息,链接:https://www.cnblogs.com/mrjade/p/9912073.html,本文将继续带大家进行修改,重点是添加饼图 1.修改测试 ...

  10. 在腾讯开发 QQ IM 的工作体验是怎样的?

    转载 http://blog.csdn.net/kobejayandy/article/details/8685271 目录 一.引言 二.个人网站 三.Oracle/支付宝/旺旺 四.淘宝技术发展( ...