上一页 1 ··· 4 5 6 7 8
摘要: 得到一个图片的尺寸,identify test.png结果为:test.png PNG 178x15 178x15+0+0 16-bit PseudoClass 65536c 2.28kb使用shellidentify test.png | cut -d ' ' -f 3 | cut -d 'x' -f 1identify test.png | cut -d ' ' -f 3 | cut -d 'x' -f 2分别得到宽和高不过要是在java中通过runtime来运行这个命令是很麻烦的,它使用空格把参数分割出来的,它不会认为引号引 阅读全文
posted @ 2013-06-13 21:21 代码收集-ASP。JS代码 阅读(372) 评论(0) 推荐(0)
摘要: PHP 大小写转换1.将字符串转换成小写 strtolower(): 该函数将传入的字符串参数所有的字符都转换成小写,并以小定形式放回这个字符串.例:<?php $str = "I want To FLY"; $str = strtolower($str); echo $str;?>输出结果:i want to fly2.将字符转成大写 strtoupper(): 该函数的作用同strtolower函数相反,是将传入的字符参数的字符全部转换成大写,并以大写的形式返回这个字符串.用法同strtolowe()一样.3.将字符串首字符转换成大写 usfilst(): 阅读全文
posted @ 2013-06-13 16:48 代码收集-ASP。JS代码 阅读(511) 评论(0) 推荐(0)
摘要: function remote_filesize($uri,$user='',$pw=''){ // start output buffering ob_start(); // initialize curl with given uri $ch = curl_init($uri); // make sure we get the header curl_setopt($ch, CURLOPT_HEADER, 1); // make it a http HEAD request curl_setopt($ch, CURLOPT_NOBOD... 阅读全文
posted @ 2013-06-13 15:38 代码收集-ASP。JS代码 阅读(334) 评论(0) 推荐(0)
摘要: 我是小白,代码略加了一点小修改function htmldecode($str){if(empty($str)) return;if($str=="") return $str;$str=str_replace("&",chr(34),$str);$str=str_replace(">",">",$str);$str=str_replace("<","<",$str);$str=str_replace("&",&qu 阅读全文
posted @ 2013-06-06 20:20 代码收集-ASP。JS代码 阅读(333) 评论(0) 推荐(0)
摘要: lightbox类效果为了让图片居中显示而使用预加载,需要等待完全加载完毕才能显示,体验不佳(如filick相册的全屏效果)。javascript无法获取img文件头数据,真的是这样吗?本文通过一个巧妙的方法让javascript获取它。这是大部分人使用预加载获取图片大小的例子:01varimgLoad =function(url, callback) {02varimg =newImage();0304img.src = url;05if(img.complete) {06callback(img.width, img.height);07}else{08img.onload =functi 阅读全文
posted @ 2013-05-13 20:47 代码收集-ASP。JS代码 阅读(249) 评论(0) 推荐(0)
摘要: 很多框架存在父子关系,操作起来十分麻烦,很多同学经常出现这样悲催的代码:1window.parent.document.getElementById("main")2.contentWindow.document.getElementById('input').value =3document.getElementById('myIframe')4.contentWindow.document.getElementById('s0').value;其实这个问题可以被大大的简化,框架应用中有一个固定不变的窗口叫window.to 阅读全文
posted @ 2013-05-13 20:45 代码收集-ASP。JS代码 阅读(291) 评论(0) 推荐(0)
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-t... 阅读全文
posted @ 2010-04-11 07:40 代码收集-ASP。JS代码 阅读(920) 评论(1) 推荐(0)
上一页 1 ··· 4 5 6 7 8