2010-02-03 18:33
$d = explode("/",$daytime]);
$dates = $d[2]."-".$d[1]."-".$d[0];
______________________________
list($d,$m,$y) = explode( '/ ', $d);
echo date( 'Y-m-d ', mktime(0,0,0,$m,$d,$y)); |
2010-01-26 16:48
演示效果:http://www.jankr.com/demo/t/
PHP代码
<?php
$url='../images'; //图片地址,只可以用./you/images这样的路径
$files=array();
if ($handle=opendir("$url")) {
while(false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
|
2010-01-18 17:23
什么是CKEditor?
CKEditor即大名鼎鼎的FCKeditor终于在最近发布新版本了,与增加版本号不同,这次完全把它改名了,更名为CKeditor。这应该是和它的开发公司CKSource的名字有关吧,该公司的另一个产品为CKFinder(一个Ajax文件管理器),这次可能为了保持一致,将FCK更改为CK,但是版本号继承了下来,为CKeditor3.0版。
FCKeditor项目已转向下一代版本命名CKEditor的产品开发,基本上采用Fckeditor并对部分进行了重新设计和采用新技术以改善结构。最新版本是cke |
2010-01-14 14:51
1、只允许输入数字
<input name="username" type="text" onkeyup="value=this.value.replace(/\D+/g,'')">
2、只允许输入英文字母、数字和下划线(以下二种方法实现)
<input name="username" type="text" style="ime-mode:disabled">
|
2009-12-17 14:33
一般来说,就是使用遍历的方法,判断每个Radio是否被选中,如果是,再取其值.
1:找出网页中所有控件的name为"rdPort" 的控件,再遍历判断
var ip="";
var rPort = docum |
2009-12-15 10:58
1.取消按钮按下时的虚线框
在input里添加属性值 hideFocus 或者 HideFocus=true
2.只读文本框内容
在input里添加属性值 readonly
3.防止退后清空的TEXT文档(可把style内容做做为类引用)
<INPUT style=behavior:url(#default#savehistory); type=text id=oPersistInput>
4.ENTER键可以让光标移到下一个输入框
<input onkeydown="if(event.keyCode==13)event.keyCode=9" >
5.只能为中文(有闪动)
<input onkeyup="value= |
2009-12-09 16:09
<!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=utf-8" />
<title>实时统计提示输入框已经输入的字符数</title>
</head>
<body>
你已经输入<div id="tip" style=" color:#58 |
2009-12-08 11:24
<script language="javascript">
var a = encodeURI("电影");
alert(a);
var b = decodeURI(a);
alert(b)
</script>
<?php
$a = urlencode(iconv("gb2312", "UTF-8", "电影")); //等同于javascript encodeURI("电影");
echo $a;
$b = iconv("utf-8","gb2312",urldecode("%E7%94%B5%E5%BD%B1")); //等同于javascript decodeURI |
2009-12-03 10:47
1.substring 方法
定义和用法
substring 方法用于提取字符串中介于两个指定下标之间的字符。
语法
stringObject.substring(start,stop)
参数 描述
start 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。
stop 可选。一个非负的 |
2009-11-30 18:24
调用函数时用 $str = random(5);
<?php
function random($length, $numeric = 0) {
if (!isset($length)) $length = rand(2,4);
//加入$length=rand(2,4)就可以了
PHP_VERSION < '4.2.0' && mt_srand((double)microtime() * 1000000);
if ($numeric) {
$hash = sprintf('%0'.$length.'d', mt_rand(0, pow(10, $length) - 1));
} else {
$hash = '';
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$max = strlen($chars) |
|
|
codylee
男, 27岁
广东 广州
加为好友
|