查找了数据库,再在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. CentOS7设置自定义开机启动,添加自定义系统服务

    Centos 系统服务脚本目录: /usr/lib/systemd/ 有系统(system)和用户(user)之分,如需要开机没有登陆情况下就能运行的程序,存在系统服务(system)里,即: lib ...

  2. 在Spring中注入Java集合

    集合注入重要是对数组.List.Set.map的注入,具体注入方法请参照一下代码(重点是applicationContext.xml中对这几个集合注入的方式): 1.在工程中新建一个Departmen ...

  3. springcloud Ribbon自定义负载均衡插件

    现在我们通过插件的方式添加新的一种策略. package com.zhuyang.config; import org.springframework.beans.factory.annotation ...

  4. 依据经纬度返回地址的url -- GoogleMap

    latlng=34,112">https://maps.googleapis.com/maps/api/geocode/xml? latlng=34,112

  5. 最简短的openvpn的设置方式

    这种方式对于测试能否连接到远程系统,十分的有用.尤其是国内复杂的网络环境下,检测一下,到底是服务器的原因,还是网络因素造成的,这是一个快捷的方式. 需要注意的是:这种方法是用明文连接.所有的加密措施都 ...

  6. 又发现一个visual studio 2015的坑啊。

    又发现一个visual studio 2015的坑啊...我的后台管理的目录名称叫@duck, 但是在新版VS2015中打开项目后编译,出现错误: Error opening response fil ...

  7. SQL Server 创建约束图解 唯一 主键

    SQLServer中有五种约束,Primary Key约束.Foreign Key约束.Unique约束.Default约束和Check约束,今天使用SQL Server2008来演示下这几种约束的创 ...

  8. Oracle 12C 在 Oracle Linux 6.5 64Bit 安装手冊

    Oracle 12C  在 Oracle Linux 6.5 64Bit 安装手冊.step by step 下载地址: http://download.csdn.net/detail/rlhua/7 ...

  9. win7下安装curl

    先去官网下载curl,地址https://winampplugins.co.uk/curl/,我下载的版本是curl_7_52_1_openssl_nghttp2_x64.然后执行curl.exe并且 ...

  10. 递增和递减进度条CCProgressTimer

    关于scheduleUpdate看这篇即可 http://www.benmutou.com/blog/archives/56 接下来是示例代码: CCSize size = CCDirector::s ...