PHPExcel官方读取的几个例子

  • 黄楚恒
  • 2017-08-16 16:25:02
  • PHP
  • php
1.使用 PHPExcel_IOFactory 读取文件  
    $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);          
2.使用一个特定的读取类,读取文件  
    $objReader = new PHPExcel_Reader_Excel5();                    
    objPHPExcel = $objReader->load($inputFileName);  
3.使用 PHPExcel_IOFactory 创建一个特定的读取类  
    $objReader = PHPExcel_IOFactory::createReader($inputFileType);    
    $objPHPExcel = $objReader-...
		                        

PHP超级全局变量、魔术变量和魔术函数

  • 黄楚恒
  • 2017-07-10 10:21:00
  • PHP
  • php
      PHP在设计的时候已经预定义了9个超级全局变量、8个魔术变量和13魔术函数,这些变量和函数可以在脚本的任何地方不用声明就可以使用。 在PHP开发会频繁的使用这些变量和函数,这些变量和函数可以方便的帮我们解决很多问题。下面详细的讲解下PHP中的超级全局变量、魔术变量和魔术函数。
PHP超级全局变量(9个)
  $GLOBALS  储存全局作用域中的...

php获取url后缀名

  • 黄楚恒
  • 2017-06-29 15:44:01
  • PHP
  • php
<?php
	function getExt($url){
		$arr = parse_url($url);//parse_url解析一个 URL 并返回一个关联数组,包含在 URL 中出现的各种组成部分
	    //'scheme' => string 'http' (length=4)
	    //'host' => string 'www.sina.com.cn' (length=15)
	    //'path' => string '/abc/de/fg.php' (length=14)
	    //'query' => string 'id=1' (length=4)	
		$file = basename($arr['path']);// basename函数返回路径中的文件名部...
		                        

php遍历文件夹下的所有文件和子文件夹

  • 黄楚恒
  • 2017-06-29 14:13:25
  • PHP
  • php
<?php
    function my_dir($dir) {
        $files = array();
        if(@$handle = opendir($dir)) { //注意这里要加一个@,不然会有warning错误提示:)
            while(($file = readdir($handle)) !== false) {
                if($file != ".." && $file != ".") { //排除根目录;
                    if(is_dir($dir."/".$file)) { //如果是子文件夹,就进行递归
                        $files[$file] = my_dir($di...
		                        

jQuery动画

show() 显示隐藏的匹配元素
//将选中的元素显示出来
$("p").show();

//将选中的元素缓慢的显示出来,有slow、normal、fast 或者是毫秒数
$("p").show("slow");

//回调函数,完成效果后执行这个函数
$("p").show("fast",function(){
   $(this).text("show time !");

 });


hide() 隐藏显示的元素
//将选中的元素隐藏...

jQuery常用事件

click 触发每一个匹配元素的click事件。
  //将页面内所有段落点击后隐藏。
  $("p").click( function () { $(this).hide(); });

mouseover 当鼠标指针位于元素上方时,会发生 mouseover 事件。
  //当鼠标指针位于元素上方时时,改变元素的背景色:
   $("p").mouseover(function(){
        $("p").css("background-color","yellow");

...

jQuery 常用词汇

开头简写: $(function($){// 你可以在这里继续使用$作为别名...});

选择器:

$('#id') 根据给定的ID匹配一个元素
$('.class') 根据给定的类匹配元素
$('tag') 根据给定的元素名匹配所有元素


$('li:eq(1)') 获取下标为1的li标签
$('#box li:last') 获取id为box的对象里面最后一个li标签
$('#box li:first') 获取id为box...

HTML 手机端

  • 黄楚恒
  • 2017-06-27 10:59:22
  • HTML
  • HTML
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
在网页的<head>中增加以上这句话,可以让网页的宽度自动适应手机屏幕的宽度。
其中:

width=device-width :表示宽度是设备屏幕的宽度

initial-scale=1.0:表示初始的缩放比例

minimum-scale=0.5:表示最小的缩放比例

maximum-scale...

HTML input标签

  • 黄楚恒
  • 2017-06-27 10:47:06
  • HTML
  • HTML
<input> 标签
属性 说明
type input元素类型
name input 元素的名称
value input 元素的值
size input 元素的宽度
readonly 是否只读
maxlength 输入字符的最大长度
disabled 是否禁用

1.文本框
<input type="text" name="username" value="" />
2.密码框
<input type="password"name="passwd"/>
3.单选按钮
<input type="radio"name="sex"v...

thinkPHP中url模式中隐藏入口文件index.php的方法

thinkPHP中url模式中隐藏入口文件index.php的方法:
1.httpd.conf配置文件中加载了mod_rewrite.so模块  //在APACHE里面去配置
#LoadModule rewrite_module modules/mod_rewrite.so把前面的警号去掉

2.确保URL_MODEL设置为2,在项目的配置文件里写
return Array(
   'URL_MODEL' => '2', //重写模式
);


3需要在入口文件的同级添加 .htaccess文件
这个文...

Copyright © 2016-2019 709173702@qq.com 版权所有  ICP证粤ICP备16117826号-1
联系邮箱:709173702@qq.com