jump display
查找了数据库,再在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的更多相关文章
- 设备管理 USB ID
发现个USB ID站点,对于做设备管理识别的小伙伴特别实用 http://www.linux-usb.org/usb.ids 附录: # # List of USB ID's # # Maintain ...
- 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 ...
- I.MX6 U-boot lvds display hacking
/*********************************************************************************** * I.MX6 U-boot ...
- CSS HTML元素布局及Display属性
本篇文章主要介绍HTML的内联元素.块级元素的分类与布局,以及dispaly属性对布局的影响. 目录 1. HTML 元素分类:介绍内联元素.块级元素的分类. 2. HTML 元素布局:介绍内联元素. ...
- 从display:run-in;中学习新技能
有时我们想在一行内显示一个标题,以及一段内容,虽然看起来比较简单,但是为了语义化用dl比较合适,但是它默认是block元素,改成inline?那么有多段呢?不就都跑上来了?用float?那问题也挺多. ...
- [转]thinkphp 模板显示display和assign的用法
thinkphp 模板显示display和assign的用法 $this->assign('name',$value); //在 Action 类里面使用 assign 方法对模板变量赋值,无论 ...
- [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 ...
- [LeetCode] Jump Game 跳跃游戏
Given an array of non-negative integers, you are initially positioned at the first index of the arra ...
- [LeetCode] Jump Game II 跳跃游戏之二
Given an array of non-negative integers, you are initially positioned at the first index of the arra ...
随机推荐
- c编程:求出4×4矩阵中最大和最小元素值及其所在行下标和列下标,求出两条主对角线元素之和。
//求出4×4矩阵中最大和最小元素值及其所在行下标和列下标,求出两条主对角线元素之和 #include <stdio.h> int main() { int sum=0; int max, ...
- jenkins 发送邮件模板
jenkins 发送邮件模板 <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> ...
- mysql-cluster 环境安装&配置
一.mysql-cluster 的介绍: 1.说心里话mysql-cluster这货性能上是不行的,之前一个同事测试了来的结果是8个主机组成的mysql-cluster性能 上搞不过一个单机的mysq ...
- 基于EM的多直线拟合实现及思考
作者:桂. 时间:2017-03-22 06:13:50 链接:http://www.cnblogs.com/xingshansi/p/6597796.html 声明:欢迎被转载,不过记得注明出处哦 ...
- Mac中提升权限修改系统目录
原来OSX EI Capitan中增加了一个SIP功能,不管你是不是su,都会阻止你在系统目录下进行操作.如果,想要修改系统目录的文件,如升级bash,需要修改/bin/bash,那么就要先关闭SIP ...
- Msys2:windows下好用的unix模拟器
msys2是基于mingw的bash模拟器,他为在windows下使用类似unix的环境提供了方便.同时,他还是基于mingw的,所以,他生成的也是原生的windows程序. msys2官方网站是:h ...
- 恶意程序入侵 dbuspm-session 发现了新的方法制这种恶意程序
直接从一台没服务器上把这两文件scp到当前的服务器上并替换这两个程序就ok了!!!!这种方法测试成功!!!! 出现了一个比效麻烦的事,服务器的负载正常,内存也正常,但就是很卡. 通过查找到线索:htt ...
- RSS Feeds with Spring Boot
http://nixmash.com/post/rss-feeds-with-spring-boot **************************************** We added ...
- js中作用域和闭包
作用域链实例 (1) function example() { var age = 23; alert(age) } var age = 25; example(); alert(age); // ...
- 一个div层在页面上下左右居中以及数据的排序
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...