易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP常用函数推荐

 
1.产生随机字符串函数
function random($length) {
 $hash = '';
 $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
 $max = strlen($chars) - 1;
 mt_srand((double)microtime() * 1000000);
 for($i = 0; $i < $length; $i++) {
  $hash .= $chars[mt_rand(0, $max)];
 }
 return $hash;
}
2.截取一定长度的字符串
注:该函数对GB2312使用有效
function wordscut($string, $length ,$sss=0) {
 if(strlen($string) > $length) {
               if($sss){
                      $length=$length - 3;
                      $addstr=' ...';
                }
  for($i = 0; $i < $length; $i++) {
   if(ord($string[$i]) > 127) {
    $wordscut .= $string[$i].$string[$i + 1];
    $i++;
   } else {
    $wordscut .= $string[$i];
   }
  }
  return $wordscut.$addstr;
 }
 return $string;
}
3.取得客户端IP地址
function GetIP(){
             if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown"))
                   $ip = getenv("HTTP_CLIENT_IP");
             else if (getenv("HTTP_X_FORWARDED_FOR") && strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown"))
                &n


相关文档:

blog源码整理:php+mysql博客程序25种

Blog系统作为大家最常接触的互联网东东,在站长群体中几乎人手一博,从知名门户的博客频道,到网络营销专家博客,网民对博客的关注度在不断提高并深化。目前网上免费的blog系统太杂,在此整理PHP版的Blog介绍如下:
1、wordpress:http://www.wordpress.org 功能也很全面,应该是支持blog的首选。它有最强的模版功能,已经 ......

PHP实现文件的读和写功能

进行文件的读和写,先打开一个文件,然后开始读或者写文件,最后再关系这个文件资源。
如,文件的读操作:
<?php
$file = fopen('your file path','r');
while(!feof($file)){ //当没有读取到文件结尾,继续循环读取操作
$line = fgets($file); //读取到一行的内容
echo $line.'<br/>';
}
fclose($file) ......

php显示时间代码

一、PHP函数Date()获取当前时间
代码:
<?php echo $showtime=date("Y-m-d H:i:s");?>
显示的格式: 年-月-日 小时:分钟:秒
相关参数:
a:"am"或者"pm"
A:"AM"或者"PM"
d:几日,二位数字,若不足二位则前面补零,如: "01"至"31"
D:星期几,三个英文字母,如: "Fri"
F:月份,英文全名,如: "Jan ......

php中substr的用法详解

php中substr的用法详解
php.net中关于substr的说明很简单:
start
If start is non-negative, the returned string will start at the start 'th position in string , counting from zero. For instance, in the string 'abcdef', the character at position 0 is 'a', the character at position 2 is 'c', and so for ......

php的数据操作ui

 <?php
 
error_reporting(0);//7all,0no
ini_set('display_errors', '0');
function myerror($errno, $errstr, $errfile, $errline)
{
    echo "<BR>error type: [$errno] $errstr<br />\n";
    echo "in line $errline of file $errfile<BR>";
} ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号