查找了数据库,再在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. 下载url地址的图片

    // string url = "https://api.weixin.qq.com/cgi-bin/media/get?access_token=cNaaMfvhpb1vmcVRXRAdI ...

  2. typedef的用法再思考

    最近重读c语法,有所感悟,记录. 有时候感悟,其实就是猜,假想,作者创建语言的想法,通俗的讲就是丹尼斯灵魂附体了,这个时候任何c语言难点对于你来说,就像吃饭喝水一样简单了,同时还能发现它优美动人之处. ...

  3. lattice diamond 3.7安装破解

    第一步安装:执行.EXE文件,一直下一步,最后license选择没有USB什么的那个(具体记不清了). 第二步破解:安装完成后在环境变量中将license路径指定到license文件即可(LM_LIC ...

  4. 如何学好FPGA

    http://bbs.elecfans.com/jishu_278578_1_1.html 掌握FPGA可以找到一份很好的工作,对于有经验的工作人员,使用FPGA可以让设计变得非常有灵活性.掌握了FP ...

  5. X64 Deep Dive

    zhuan http://www.codemachine.com/article_x64deepdive.html X64 Deep Dive This tutorial discusses some ...

  6. Python 2.7.9 Demo - 005.字符串判空

    #coding=utf-8 #!/usr/bin/python str1 = None; str2 = ''; str3 = ' '; if str1 == None : print("st ...

  7. js正则表达式判断一个字符串是否是正确的有数字和小数点组成的金钱形式和 判读数值类型的正则表达式

    function checkRates(str){    var re = /^(([1-9][0-9]*\.[0-9][0-9]*)|([0]\.[0-9][0-9]*)|([1-9][0-9]*) ...

  8. js怎么让时间函数的秒数在页面上显示是变化的

    <input type="text" id="showtime" value="" /><script type=&quo ...

  9. JSP页面最终是编译为Servlet执行的

    JSP页面最终是编译为Servlet执行的,你可以在Tomcat的%CATALINA_HOME%/work/Catalina/localhost中找到一个文件夹,该文件夹跟你的web-project的 ...

  10. 通过Windows PowerShell远程管理计算机(精简版)

    现在你手中有一台server(主控端),你打算通过主控端远程管理多台server(被控端).这个过程可以通过Windows PowerShell来完成. 首先在被控端上以管理员权限打开PowerShe ...