js弹框函数: split():用于把一个字符串分割成字符串数组 toUpperCase(): substr(): 查找 indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置 lastIndexOf():可返回一个指定的字符串值最后出现的位置,在一个字符串中的指定位置从后向前搜索...
分类:
编程语言 时间:
2015-09-01 10:31:41
阅读次数:
150
1strlen()计算字符串的长度。strlen(‘hello‘);2substr();截取字符串,三个参数,string,start,length1)substr(string,start)-->得到以strat为起点的字符串。备注:起点也是从0开始的2)substr(string,-1)--》如果是负数,得到原字符串尾部的一个字符串。3)substr(string,..
分类:
Web程序 时间:
2015-08-31 23:53:30
阅读次数:
215
UUID也叫GUID,全局唯一标识符在PHP中生成的方式,可以定义一个函数,在新增数据的时候专门调用1functionguid(){ $str=md5(uniqid(mt_rand(),true)); $uuid=substr($str,0,8).‘-‘; $uuid.=substr($str,8,4).‘-‘; $uuid.=substr($str,12,4).‘-‘; $uuid.=substr($str,16,4).‘-‘; ..
分类:
Web程序 时间:
2015-08-29 01:00:20
阅读次数:
318
1、截取字符串oracle截取字符串用到了一个函数substr,参数为:substr(字符串,起始位置,截取长度),例如:字符串123,112,需要将末尾逗号去掉,那么截取函数如下:select substr('123,112,',0,length('123,112,')-1) from dual;结果:123,1122、替换字符串使用函数:replace,如下:select replace('...
分类:
数据库 时间:
2015-08-28 19:50:49
阅读次数:
151
<?php $array=array("index.php","indexssss.php","indexss.php");$isin = in_array(substr($_SERVER['PHP_SELF'],6),$array);if($isin){echo "有权限!";}else{echo...
分类:
其他好文 时间:
2015-08-28 13:07:53
阅读次数:
119
今天在工作的过程中,看到js中两个双胞胎函数。分别是substring与substr。顿时被两个可恶的家伙给迷惑住了,不知道具体有什么作用。、先来看看substring手册是怎么介绍的。手册解释的还是比较清楚的。不过还是用我的自己话给总结一下,顺便来个栗子巩固一下。在这里你可以把字符串当成类数组的对...
分类:
Web程序 时间:
2015-08-27 21:01:28
阅读次数:
188
首先定义一个变量便于下面测试:var str = "xx351223441";substring:str.substring(form,to):从字符串里截取下标为form到下标为to的字符串(不包括to对应的字符)alert(str.substring(2,6)) // 3512当form>to....
分类:
其他好文 时间:
2015-08-27 13:12:53
阅读次数:
147
function GetQueryString(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!=null)...
分类:
Web程序 时间:
2015-08-27 02:07:26
阅读次数:
133
问题描述:设置一个起始位置,寻找主串中第一次出现子串的首位置。
算法实现:
int index(string str,string substr,int pos)
{
int i=0,j=0;
int slen,sslen;
i=pos;
slen=str.length();
sslen=substr.length();
while(i+sslen<slen)
{
whi...
分类:
编程语言 时间:
2015-08-26 22:33:43
阅读次数:
309
function myDecode($str){ $str = substr(str_replace('\"','"',json_encode($str)),1,-1); return json_decode($str); }
分类:
Web程序 时间:
2015-08-26 15:17:20
阅读次数:
128