php获取当前页面url地址及参数
获取协议 - http
url的协议,可以读出在$ _server ['server_protocol']变量。
*/
echo $_server['server_protocol'];
/*
如果你检查值,可以发现,不只是http或https,但这样的字符串:http/1.1的
*/
$protocol = strpos(strtolower($_server['server_protocol']),'https') === false ? 'http' : 'https';
/*
获取主机域名*/
$host = $_server['http_host'];
/*
利用$ _server['script_name']获取除域名外的php文件与路径
*/
$script = $_server['script_name'];
//获取?后面查询参数
$params = $_server['query_string'];
//方法二
$uri = $_server['request_uri'];
//下面来看一个完整的获取当前url实例
$protocol = strpos(strtolower($_server['server_protocol']),'https') === false ? 'http' : 'https';
$host = $_server['http_host'];
$script = $_server['script_name'];
$params = $_server['query_string'];
$currenturl = $protocol . '://' . $host . $script . '?' . $params;
echo $currenturl;
$validcharacters = "abcdefghijklmnopqrstuxyvwzabcdefghijklmnopqrstuxyvwz+-*#&@!?";
$index = mt_rand(0, 10);
echo $index;
//看一款复杂一点的
$validcharacters = "abcdefghijklmnopqrstuxyvwzabcdefghijklmnopqrstuxyvwz+-*#&@!?";
$validcharnumber = strlen($validcharacters);
$index = mt_rand(0, $validcharnumber-1);
$randomcharacter = $validcharacters[$index];
echo $randomcharacter;
//实例二
$length = 5;
$result = "";
for ($i = 0; $i < $length; $i++) {
$index = mt_rand(0, $validcharnumber-1);
$result .= $validcharacters[$index];
}
//
function getrandomstring($length = 6) {
$validcharacters = "abcdefghijklmnopqrstuxyvwzabcdefghijklmnopqrstuxyvwz+-*#&@!?";
$validcharnumber = strlen($validcharacters);
$result = "";
for ($i = 0; $i < $length; $i++) {
$index = mt_rand(0, $validcharnumber - 1);
$result .= $validcharacters[$index];
}
return $result;
}
echo getrandomstring();
服务器端传送的数据仍是gb2312编码,客户端用js将汉字转变成utf8编码显示在页面
方法一json
一,服务器端json数据用php教程的iconv函数转换:iconv('gb2312', 'utf8', "被转换字符串,输出到浏览器");
客户端获取utf8数据,再转成gb2312:
function gb2utf8(data){//gb编码是,ie通过二进制码utf8->gbk转为中文
var glbencode = [];
gb2utf8_data = data;
execscript("gb2utf8_data = midb(gb2utf8_data, 1)", "vbscript");
var t=escape(gb2utf8_data).replace(/%u/g,"").replace(/(.{2})(.{2})/g|>,"%$2%$1").replace(/%([a-z].)%(.{2})/g|>,"@$1$2");
t=t.split("@");
var i=0,j=t.length,k;
while(++i<j)>
k=t.substring(0,4);
if(!glbencode[k]) {
gb2utf8_char = eval("0x"+k);
execscript("gb2utf8_char = chr(gb2utf8_char)", "vbscript");
glbencode[k]=escape(gb2utf8_char).substring(1,6);
}
t=glbencode[k]+t.substring(4);
}
gb2utf8_data = gb2utf8_char = null;
return unescape(t.join("%"));
}
二,header("content-type", "application/x-www-form-urlencoded; charset=gbk"); //输出头标,设置为gbk编码
三,在ajax请求数据前调用上面的方法指定请求使用的字符集:xmlhttp.setrequestheader( "content-type", "application/x-www-form-urlencoded;charset=gbk");
方案二
search.php
<?php
header("content-type: text/html; charset=gb2312");
include './search.htm';
?>
search.htm
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>高级搜索</title>
</head>
<body>
<h3>高级搜索</h3>
<form method="post" action="">
学校类型:
<select name="schooltype">
<option value="">全部</option>
<option value="1">小学</option>
<option value="2">初中</option>
</select>
学校名称:
<select name="sid" id="sid">
<option value="">请选择学校</option>
</select>
</form>
<script type="text/网页特效">
function ajax(settings) {
var xhr = window.activexobject ? new activexobject("microsoft.xmlhttp") : new xmlhttprequest(), successed = false;
xhr.open(settings.type, settings.url);
if(settings.type == 'post')
xhr.setrequestheader('content-type', 'application/x-www-form-urlencoded');
xhr.send((!settings.cache ? 'time=' + new date().gettime() + '&' : '') + settings.data);
settings.loader();
settimeout(function() {
if(!successed) {
alert('resquest timeout!');
xhr.abort();
}
}, settings.timeout);
xhr.onreadystatechange = function() {
if (xhr.readystate == 4 && xhr.status == 200) {
settings.callback(xhr.responsetext.replace(/(^s*)|(s*$)/g, ""));
}
successed = true;
}
}
function a(t) {
ajax({
type: 'post',
url: 'ajax.php',
data: 'schooltype=' + t,
timeout: 8000,
cache: true,
loader: function() {},
callback: function(d) {
var arr = eval(d);
if(typeof(arr) == 'object') {
var obj, option;
document.getelementbyid('sid').innerhtml = '';
for(var i = 0; obj = arr; i ++) {
option = document.createelement('option');
option.value = obj[0];
option.innerhtml = txt2utf8(obj[1], '&#');
document.getelementbyid('sid').appendchild(option);
}
}
}
})
}
function txt2utf8(string, prefix){
for(var i=0,utf8=[];i<string.length;utf8.push((prefix||'u')+string.charcodeat(i++)));
return utf8.join('');
}
a(0);
</script>
</body>
</html>ajax.php
<?php
header("content-type: text/html; charset=gb2312");
$schooltype = !empty($_post['schooltype']) ? $_post['schooltype'] : 0;
switch($schooltype) {
case 0:
echo "[['40', '太平溪镇花栗包完全小学'],['41', '太平溪镇长岭黑龙江希望小学'],['42', '乐天溪镇初级中学'],['43', '乐天溪镇莲沱初级中学']]";
break;
case 1:
echo "[['40', '太平溪镇花栗包完全小学'],['41', '太平溪镇长岭黑龙江希望小学']]";
break;
case 2:
echo "[['42', '乐天溪镇初级中学'],['43', '乐天溪镇莲沱初级中学']]";
break;
default:
break;
}
?>
<?php教程
/*
* 模板分页类,源于easp教程的数据库教程分页方法,算是easp分页的的php独立版
* 支持动态和静态分页方式
* * page([总记录数=1],[分页大小=20],[当前页=1],[显示页数=6],[分页参数='page'],[分页链接=当前页面],[是否静态=false])
* 动态:
* 简单用法:
* $page = new page(50);
* $page->setpager('zjj','<div class="newpager">共有{recordcount} 个商品 当前第 {pageindex} 页 / 共 {pagecount} 页 分页: {first}{prev} {list} {next}{last} 转到 {jump} 页</div>',array("listlong"=>"6","first"=>"首页","last"=>"尾页","prev"=>"上一页","next"=>"下一页","list"=>"第*页","jump"=>"select"));
* echo $page->getpager('zjj');
* 全参数用法:
* $page = new page(50,20,1,6,'page','prrr.php',false);
* $page->setpager('zjj','<div class="newpager">共有{recordcount} 个商品 当前第 {pageindex} 页 / 共 {pagecount} 页 分页: {first}{prev} {list} {next}{last} 转到 {jump} 页</div>',array("listlong"=>"6","first"=>"首页","last"=>"尾页","prev"=>"上一页","next"=>"下一页","list"=>"第*页","jump"=>"select"));
* echo $page->getpager('zjj');
* 静态:
* $page = new page(50,20,1,6,'page','prrr{page}.html',true);
* $page->setpager('zjj','<div class="newpager">共有{recordcount} 个商品 当前第 {pageindex} 页 / 共 {pagecount} 页 分页: {first}{prev} {list} {next}{last} 转到 {jump} 页</div>',array("listlong"=>"6","first"=>"首页","last"=>"尾页","prev"=>"上一页","next"=>"下一页","list"=>"第*页","jump"=>"select"));
* echo $page->getpager('zjj');
*/
class page {
private $page_size; //每页显示的条目数
private $total_size; //总条目数
private $current_page; //当前被选中的页
private $sub_pages; //每次显示的页数
private $total_pages; //总页数
private $page_tpl = array (); // 分页模板
private $pageparam;
private $pagelink;
private $static;
function __construct($total_size = 1, $page_size = 20, $current_page = 1, $sub_pages = 6, $pageparam = 'page', $pagelink = '', $static = false) {
$this->page_size = intval ( $page_size );
$this->total_size = intval ( $total_size );
if (! $current_page) {
$this->current_page = 1;
} else {
$this->current_page = intval ( $current_page );
}
$this->total_pages = ceil ( $total_size / $page_size );
$this->sub_pages = intval ( $sub_pages );
$this->pageparam = $pageparam;
$this->pagelink = (empty ( $pagelink ) ? $_server ["php_self"] : $pagelink);
$this->static = $static;
$this->page_tpl ['default'] = array ('tpl' => '<div class="pager">{first}{prev}{liststart}{list}{listend}{next}{last} 跳转到{jump}页</div>', 'config' => array () );
}
public function __set($param, $value) {
$this->$param = $value;
}
public function __get($param) {
return $this->$param;
}
/*
__destruct析构函数,当类不在使用的时候调用,该函数用来释放资源。
*/
function __destruct() {
unset ( $page_size ); //每页显示的条目数
unset ( $total_size ); //总条目数
unset ( $current_page ); //当前被选中的页
unset ( $sub_pages ); //每次显示的页数
unset ( $total_pages ); //总页数
unset ( $page_tpl ); // 分页模板
unset ( $pageparam ); //分页参数,默认page
unset ( $pagelink );
unset ( $static );
}
private function urlparameters($url = array()) {
foreach ( $url as $key => $val ) {
if ($key != $this->pageparam)
$arg [] = $key . '=' . $val;
}
$arg [] = $this->pageparam . '=*';
if ($this->static)
return str_replace ( '{page}', '*', $this->pagelink );
else
return $this->pagelink . '?' . implode ( '&', $arg );
}
public function setpager($tpl_name = 'default', $tpl = '', $config = array()) {
if (empty ( $tpl ))
$tpl = $this->page_tpl ['default'] ['tpl'];
if (empty ( $config ))
$config = $this->page_tpl ['default'] ['config'];
$this->page_tpl [$tpl_name] = array ('tpl' => $tpl, 'config' => $config );
}
public function getpager($tpl_name = 'default') {
$this->getcurrentpage ();
return $this->pager ( $this->page_tpl [$tpl_name] );
}
public function getcurrentpage() {
$this->current_page = ($_get [$this->pageparam] <= intval ( $this->total_pages ) ? ($_get [$this->pageparam] < 1 ? 1 : $_get [$this->pageparam]) : intval ( $this->total_pages ));
}
public function pager($page_tpl = '') {
if (empty ( $page_tpl ))
$page_tpl = $this->page_tpl ['default'];
$cfg = array ('recordcount' => intval ( $this->total_size ), 'pageindex' => intval ( $this->current_page ), 'pagecount' => intval ( $this->total_pages ), 'pagesize' => intval ( $this->page_size ), 'listlong' => intval ( $this->sub_pages ), 'listsidelong' => 2, 'list' => '*', 'currentclass' => 'current', 'link' => $this->urlparameters ( $_get ), 'first' => '«', 'prev' => '‹', 'next' => '›', 'last' => '»', 'more' => '...', 'disabledclass' => 'disabled', 'jump' => 'input', 'jumpplus' => '', 'jumpaction' => '', 'jumplong' => 50 );
if (! empty ( $page_tpl ['config'] )) {
foreach ( $page_tpl ['config'] as $key => $val ) {
if (array_key_exists ( $key, $cfg ))
$cfg [$key] = $val;
}
}
$tmps教程tr = $page_tpl ['tpl'];
$pstart = $cfg ['pageindex'] - (($cfg ['listlong'] / 2) + ($cfg ['listlong'] % 2)) + 1;
$pend = $cfg ['pageindex'] + $cfg ['listlong'] / 2;
if ($pstart < 1) {
$pstart = 1;
$pend = $cfg ['listlong'];
}
if ($pend > $cfg ['pagecount']) {
$pstart = $cfg ['pagecount'] - $cfg ['listlong'] + 1;
$pend = $cfg ['pagecount'];
}
if ($pstart < 1)
$pstart = 1;
for($i = $pstart; $i <= $pend; $i ++) {
if ($i == $cfg ['pageindex'])
$plist .= '<span class="' . $cfg ['currentclass'] . '" >' . str_replace ( '*', $i, $cfg ['list'] ) . '</span> ';
else
$plist .= ' <a href="' . str_replace ( '*', $i, $cfg ['link'] ) . '"> ' . str_replace ( '*', $i, $cfg ['list'] ) . '</a> ';
}
if ($cfg ['listsidelong'] > 0) {
if ($cfg ['listsidelong'] < $pstart) {
for($i = 1; $i <= $cfg ['listsidelong']; $i ++) {
$pliststart .= '<a href="' . str_replace ( '*', $i, $cfg ['link'] ) . '">' . str_replace ( '*', $i, $cfg ['list'] ) . '</a> ';
}
$pliststart .= ($cfg ['listsidelong'] + 1) == $pstart ? '' : $cfg ['more'] . ' ';
} else {
if ($cfg ['listsidelong'] >= $pstart && $pstart > 1) {
for($i = 1; $i <= ($pstart - 1); $i ++) {
$pliststart .= '<a href="' . str_replace ( '*', $i, $cfg ['link'] ) . '">' . str_replace ( '*', $i, $cfg ['list'] ) . '</a> ';
}
}
}
if (($cfg ['pagecount'] - $cfg ['listsidelong']) > $pend) {
$plistend = ' ' . $cfg ['more'] . $plistend;
for($i = (($cfg ['pagecount'] - $cfg ['listsidelong']) + 1); $i <= $cfg ['pagecount']; $i ++) {
$plistend .= ' <a href="' . str_replace ( '*', $i, $cfg ['link'] ) . '"> ' . str_replace ( '*', $i, $cfg ['list'] ) . ' </a> ';
}
} else {
if (($cfg ['pagecount'] - $cfg ['listsidelong']) <= $pend && $pend < $cfg ['pagecount']) {
for($i = ($pend + 1); $i <= $cfg ['pagecount']; $i ++) {
$plistend .= ' <a href="' . str_replace ( '*', $i, $cfg ['link'] ) . '"> ' . str_replace ( '*', $i, $cfg ['list'] ) . ' </a> ';
}
}
}
}
if ($cfg ['pageindex'] > 1) {
$pfirst = ' <a href="' . str_replace ( '*', '1', $cfg ['link'] ) . '">' . $cfg ['first'] . '</a> ';
$pprev = ' <a href="' . str_replace ( '*', $cfg ['pageindex'] - 1, $cfg ['link'] ) . '">' . $cfg ['prev'] . '</a> ';
} else {
$pfirst = ' <span class="' . $cfg ['disabledclass'] . '">' . $cfg ['first'] . '</span> ';
$pprev = ' <span class="' . $cfg ['disabledclass'] . '">' . $cfg ['prev'] . '</span> ';
}
if ($cfg ['pageindex'] < $cfg ['pagecount']) {
$plast = ' <a href="' . str_replace ( '*', $cfg ['pagecount'], $cfg ['link'] ) . '">' . $cfg ['last'] . '</a> ';
$pnext = ' <a href="' . str_replace ( '*', $cfg ['pageindex'] + 1, $cfg ['link'] ) . '">' . $cfg ['next'] . '</a> ';
} else {
$plast = ' <span class="' . $cfg ['disabledclass'] . '">' . $cfg ['last'] . '</span> ';
$pnext = ' <span class="' . $cfg ['disabledclass'] . '">' . $cfg ['next'] . '</span> ';
}
switch (strtolower ( $cfg ['jump'] )) {
case 'input' :
$pjumpvalue = 'this.value';
$pjump = '<input type="text" size="3" title="请输入要跳转到的页数并回车"' . (($cfg ['jumpplus'] == '') ? '' : ' ' . $cfg ['jumpplus']);
$pjump .= ' onkeydown="网页特效:if(event.charcode==13||event.keycode==13){if(!isnan(' . $pjumpvalue . ')){';
$pjump .= ($cfg ['jumpaction'] == '' ? ((strtolower ( substr ( $cfg ['link'], 0, 11 ) ) == 'javascript:') ? str_replace ( '*', $pjumpvalue, substr ( $cfg ['link'], 12 ) ) : " document.location.href='" . str_replace ( '*', ''+' . $pjumpvalue . '+'', $cfg ['link'] ) . '';') : str_replace ( "*", $pjumpvalue, $cfg ['jumpaction'] ));
$pjump .= '}return false;}" />';
break;
case 'select' :
$pjumpvalue = "this.options[this.selectedindex].value";
$pjump = '<select ' . ($cfg ['jumpplus'] == '' ? ' ' . $cfg ['jumpplus'] . ' onchange="javascript:' : $cfg ['jumpplus']);
$pjump .= ($cfg ['jumpaction'] == '' ? ((strtolower ( substr ( $cfg ['link'], 0, 11 ) ) == 'javascript:') ? str_replace ( '*', $pjumpvalue, substr ( $cfg ['link'], 12 ) ) : " document.location.href='" . str_replace ( '*', ''+' . $pjumpvalue . '+'', $cfg ['link'] ) . '';') : str_replace ( "*", $pjumpvalue, $cfg ['jumpaction'] ));
$pjump .= '" title="请选择要跳转到的页数"> ';
if ($cfg ['jumplong'] == 0) {
for($i = 0; $i <= $cfg ['pagecount']; $i ++) {
$pjump .= '<option value="' . $i . '"' . (($i == $cfg ['pageindex']) ? ' selected="selected"' : '') . ' >' . $i . '</option> ';
}
} else {
$pjumplong = intval ( $cfg ['jumplong'] / 2 );
$pjumpstart = ((($cfg ['pageindex'] - $pjumplong) < 1) ? 1 : ($cfg ['pageindex'] - $pjumplong));
$pjumpstart = ((($cfg ['pagecount'] - $cfg ['pageindex']) < $pjumplong) ? ($pjumpstart - ($pjumplong - ($cfg ['pagecount'] - $cfg ['pageindex'])) + 1) : $pjumpstart);
$pjumpstart = (($pjumpstart < 1) ? 1 : $pjumpstart);
$j = 1;
for($i = $pjumpstart; $i <= $cfg ['pageindex']; $i ++, $j ++) {
$pjump .= '<option value="' . $i . '"' . (($i == $cfg ['pageindex']) ? ' selected="selected"' : '') . '>' . $i . '</option> ';
}
$pjumplong = $cfg ['pagecount'] - $cfg ['pageindex'] < $pjumplong ? $pjumplong : $pjumplong + ($pjumplong - $j) + 1;
$pjumpend = $cfg ['pageindex'] + $pjumplong > $cfg ['pagecount'] ? $cfg ['pagecount'] : $cfg ['pageindex'] + $pjumplong;
for($i = $cfg ['pageindex'] + 1; $i <= $pjumpend; $i ++) {
$pjump .= '<option value="' . $i . '">' . $i . '</option> ';
}
}
$pjump .= '</select>';
break;
}
$patterns = array ('/{recordcount}/', '/{pagecount}/', '/{pageindex}/', '/{pagesize}/', '/{list}/', '/{liststart}/', '/{listend}/', '/{first}/', '/{prev}/', '/{next}/', '/{last}/', '/{jump}/' );
$replace = array ($cfg ['recordcount'], $cfg ['pagecount'], $cfg ['pageindex'], $cfg ['pagesize'], $plist, $pliststart, $plistend, $pfirst, $pprev, $pnext, $plast, $pjump );
$tmpstr = chr ( 13 ) . chr ( 10 ) . preg_replace ( $patterns, $replace, $tmpstr ) . chr ( 13 ) . chr ( 10 );
unset ( $cfg );
return $tmpstr;
}
}
?>
本款文件上传类,默认是上传单文件的,我们只要修改$inputname ='files'为你的表单名就可以方便的实现批量文件上传了。 $savename = ''保存文件名, $alowexts = array()设置允许上传的类型,$savepath = ''保存路径。
*/
代码如下 | 复制代码 |
class upload function __construct($inputname ='files', $savepath = '', $savename = '', $alowexts = array(),$maxsize = 1024000) if(!make_dir($this->savepath)) if(move_uploaded_file($tmp_name,$this->savepath.$savename) || @copy($tmp_name,$this->savepath.$savename)) function isuploadedfile($file) //去掉系统自带的反斜线 function error() } |
//使用方法
new upload();
相关文章
- 下面本文章来给大家介绍在php中成员变量的一些对比了,文章举了四个例子在这例子中分别对不同成员变量进行测试与获取操作,下面一起来看看。 有如下4个代码示例,你认...2016-11-25
- php 获取用户IP与IE信息程序 function onlineip() { global $_SERVER; if(getenv('HTTP_CLIENT_IP')) { $onlineip = getenv('HTTP_CLIENT_IP');...2016-11-25
- php获取一个文件夹的mtime的程序了,这个就是时间问题了,对于这个问题我们来看小编整理的几个例子,具体的操作例子如下所示。 php很容易获取到一个文件夹的mtime,可以...2016-11-25
- 获取网站icon,常用最简单的方法就是通过website/favicon.ico来获取,不过由于很多网站都是在页面里面设置favicon,所以此方法很多情况都不可用。 更好的办法是通过google提供的服务来实现:http://www.google.com/s2/favi...2014-06-07
- 主要功能:获取浏览器显示区域(可视区域)的高度 : $(window).height(); 获取浏览器显示区域(可视区域)的宽度 :$(window).width(); 获取页面的文档高度 $(document).height(); 获取页面的文档宽度 :$(document).width();...2015-10-21
- 这篇文章主要给大家介绍了关于Nest.js参数校验和自定义返回数据格式的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2021-03-28
- jquery中jquery.offset().top / left用于获取div距离窗口的距离,jquery.position().top / left 用于获取距离父级div的距离(必须是绝对定位的div)。 (1)先介绍jquery.offset().top / left css: 复制代码 代码如下: *{ mar...2013-10-13
- 1、先讲讲JQuery的概念,JQuery首先是由一个 America 的叫什么 John Resig的人创建的,后来又很多的JS高手也加入了这个团队。其实 JQuery是一个JavaScript的类库,这个类库集合了很多功能方法,利用类库你可以用简单的一些代...2014-05-31
- 这篇文章主要介绍了解决Springboot get请求是参数过长的情况,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-09-17
PHP中empty和isset对于参数结构的判断及empty()和isset()的区别
废话不多说了,直接给大家贴代码了。<?php class test{} $a1 = null; $a2 = ""; //$a3 = $a4 = 0; $a5 = '0'; $a6 = false; $a7 = array(); //var $a8; $a9 = new test(); for ($i=1; $i <=9 ; $i++) {...2015-11-24- 这篇文章主要介绍了java正则表达式判断前端参数修改表中另一个字段的值,需要的朋友可以参考下...2021-05-07
- 这篇文章主要介绍了C#获取字符串后几位数的方法,实例分析了C#操作字符串的技巧,具有一定参考借鉴价值,需要的朋友可以参考下...2020-06-25
- 如果是为了取到tagName后再进行判断,那直接用下面的代码会更方便: $(element).is('input') 如果是要取到标签用作到别的地方,可以使用一下代码: $(element)[0].tagName 或: $(element).get(0).tagName...2014-05-31
- mysql安装成功后有几个默认的配置模板,列表如下: my-huge.cnf : 用于高端产品服务器,包括1到2GB RAM,主要运行mysql my-innodb-heavy-4G.ini : 用于只有innodb的安装,最多有4GB RAM,支持大的查询和低流量 my-large.cnf : 用于...2015-03-15
- 这篇文章主要介绍了C#泛型的类型参数约束的相关资料,文中讲解非常细致,帮助大家更好的理解和学习c#,感兴趣的朋友可以了解下...2020-07-31
- 复制代码 代码如下:$nodes = @$xpath->query("//*[@id='main_pr']/img/@src");$prurl = $nodes->item(0)->nodeValue;...2013-10-04
- 这篇文章主要给大家介绍了关于C#中out参数、ref参数与值参数的用法及区别的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧...2020-06-25
- 本文为代码分享,也是在工作中看到一些“大牛”的代码,做做分享。 具体是这样的,如下一个二维数组,是从库中读取出来的。 代码清单: 复制代码 代码如下: $user = array( 0 => array( 'id' => 1, 'name' => '张三', 'ema...2014-06-07
- 现实中我们经常看到这样的说明,排名不分先后,按姓名首字母进行排序。这是中国人大多数使用的排序方法。那么在php程序中该如何操作呢?下面就分享一下在php程序中获取汉字拼音的首字母的方法,在网上搜到的大多数是有问题的...2015-10-23
- 这篇文章主要介绍了Vue 组件复用多次自定义参数操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-07-27