php 948

#PHP
PHP函数copy()复制文件示例

<?php $old = 'C:\tmp\someold.txt'; $new = 'C:\tmp\somenew.txt'; copy($old,$new) or die(…

2015-01-31 520

#PHP
php通过修改header强制图片下载的代码

unction downloadFile($file){ $file_name = $file; $mime = 'application/force-download'; hea…

2015-01-31 426

#PHP
备份mysql数据的php代码

<?php ##################### //CONFIGURATIONS ##################### // Define the name o…

2015-01-31 644

#PHP
php读取指定目录下的所有文件

<?php $dir = "PUT_PATH_TO_DIR_HERE"; // Open a known directory, and proceed t…

2015-01-31 319

#PHP
计算文件大小的php代码

<?php function dirSize($directoty){ $dir_size=0; if($dir_handle=@opendir($directoty)) {…

2015-01-31 1,015

#PHP
利用imagick库把PDF转成PNG格式的PHP代码

function pdf2png($PDF,$Path){ if(!extension_loaded('imagick')){ return false; } if(!file_e…

2015-01-31 471

#PHP
php检查日期函数checkdate使用示例

语法 integer checkdate (int %Month, int $Day, int $Year); 演示代码 <?PHP echo "2/29/1900…

2015-01-31 318

#PHP
将linux运行时间格式成易读格式的php代码

<?php $exec = shell_exec('uptime'); $uptime = explode(' up ', $exec); $uptime = explode…

2015-01-31 464

#PHP
简单的php抽奖代码

<?php /** * “抽奖”函数 * * @param integer $first 起始编号 * @param integer $last 结束编号 * @param …

2015-01-31 786

#PHP
将颜色转换为其反色的PHP代码

这段php代码可以把一个颜色变成与之相反的颜色编码,如:白色变成黑色,蓝色变成黄色 function color_inverse($color){ $color = str_rep…

2015-01-31 364

#PHP
php实现简单的源码语法高亮函数

一个php实现的简单语法高亮显示的函数,注意:这个函数设计的比较简单,可能对某些语法不能高亮显示,你可以自己扩充该函数的功能 function syntax_highlight($…

2015-01-31 650

#PHP
php处理文件下载的代码

用在服务器上提供下载的php代码,可以指定被下载的文件名,可以动态指定文件内容 // local file that should be send to the client $l…

2015-01-31 795
1 60 61 62 63 64 79