摘要: <?php function down_file($file_name,$file_sub_dir){ //解决中文问题 $file_name=iconv("utf-8","gb2312",$file_name); //$file_path="./down/".$file_name;使用相对路径 $file_path=$_SERVER['DOCUMENT_ROOT'].$file_sub_dir.$file_name;//使用绝对路径 if(!file_exists($file_path)){ echo &quo 阅读全文
posted @ 2012-06-12 21:09 fengyj 阅读(110) 评论(0) 推荐(0)
摘要: 一:接口: 1,使用程序模拟现实情况、定义规范(方法、属性)。 2,当一个类实现了某个接口,则要求该类必须实现这个接口的所有方法。 3,基本使用语法:interface 接口名{//属性//方法} 4,接口中的方法都不能有方法体。 5,接口的实现:class 类名 implements 接口1,接口2{} 6,接口它的作用就是:声明一些方法,供其他类来实现它。接口还体现了编程中高内聚低耦合的特点。 7,使用接口的情况:1:定规范2:定下规范,让别的程序员来实现。3:当多个类,它们之间是平级的关系, 这些类都要去实现某个功能,只是实现的方式不一样。 接口的细节: 1,接口不能被实例... 阅读全文
posted @ 2012-06-11 21:35 fengyj 阅读(151) 评论(0) 推荐(0)
摘要: 这是抄别人的一段代码,有看到的就多学点。<div class="div3"> <SCRIPT language=JavaScript><!--var widths=500; //焦点图片宽var w=2;var widthss=widths+w;var heights=200; //焦点图片高var heightss=heightss+w;var heightt=20;var counts=3; //总条数//img1=new Image();在这里是声明了一个图片元素的对象//后面是对图像的属性进行赋值或设置,如imgs.src=" 阅读全文
posted @ 2012-06-06 21:57 fengyj 阅读(661) 评论(0) 推荐(0)
摘要: <html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"/><title>我的去向</title><link rel="stylesheet" type="text/css" href="bh.css"/><script language="javascript"> function span1( 阅读全文
posted @ 2012-06-05 21:27 fengyj 阅读(125) 评论(0) 推荐(0)
摘要: <?php //简单的 $arr=array(0,5,-1,34,89,-12,4); /*foreach($arr as $a) { echo $a."<br/>"; } sort($arr);//果然是从小到大排序。 foreach($arr as $a) { echo $a."<br/>"; }*/ //封装函数冒泡排序 function bubbleSort(&$myarr)//引用传递 { //外层循环 $temp=0; $flag=false; for($i=0;$i<count($myarr)-1 阅读全文
posted @ 2012-05-30 21:15 fengyj 阅读(137) 评论(0) 推荐(0)