查找了数据库,再在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. CodeForces 445B. DZY Loves Chemistry(并查集)

    转载请注明出处:http://blog.csdn.net/u012860063?viewmode=contents 题目链接:http://codeforces.com/problemset/prob ...

  2. Okhttp常用方法示例

    这是我用到的一个util类 public class HttpBaseService { private OkHttpClient client = new OkHttpClient(); priva ...

  3. ECSHOP后台权限分配原理分析

    1.在权限管理->管理员列表,中添加一名管理员 2.在admin\includes\inc_menu.php $modules['02_cat_and_goods']['01_goods_lis ...

  4. Install Ambari 2.2.0 from Public Repositories(Hadoop)

    Step1: Download the Ambari repository on the Ambari Server host For Redhat/CentOS/Oracle:   cd /etc/ ...

  5. js动态给table添加/删除tr的方法

    js动态给table添加/删除tr的方法. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ...

  6. RhinoMock中无参数方法和无返回值方法的使用

    无返回值方法,RhinoMock的例子是这么做的: demo.VoidThreeArgs(, "", 0f); LastCall.On(demo).Callback<int, ...

  7. 6.3 cmath--数学函数

    本模块提供了处理复数的数学函数.因此这些函数接受整数.浮点数或者复数作为參数. 6.3.1 与极坐标相互转换的函数 在Python里表示一个复数z,实部使用z.real表示,虚部使用z.imag,能够 ...

  8. Linux系统cp: omitting directory `XXX'问题解决

    在linux系统中复制文件夹时提示如下: cp: omitting directory `foldera/' 其中foldera是我要复制的文件夹名,出现该警告的原因是因为foldera目录下还存在目 ...

  9. Books from Joe's blog

    Some books that I really enjoy(ed) It's been quite some time since I blogged about what I've been re ...

  10. web 安全问题(一):CSRF 攻击

    什么是CSRF CSRF是怎么产生的 CSRF的攻击对象 CSRG的攻击手段 CSRF的防御措施 什么是CSRF 全称是(Cross Site Request Forgery)跨站请求伪造.也就是恶意 ...