php给图片加水印函数

 更新时间:2016年11月25日 16:59  点击:1922

function Watermark_IM($preview = 0) {
  global $watermarkstatus, $watermarktype, $watermarktrans, $watermarkquality, $watermarktext, $imageimpath;
  $watermarkstatus = $GLOBALS['forum']['disablewatermark'] ? 0 : $watermarkstatus;
  switch($watermarkstatus) {
   case 1:
    $gravity = 'NorthWest';
    break;
   case 2:
    $gravity = 'North';
    break;
   case 3:
    $gravity = 'NorthEast';
    break;
   case 4:
    $gravity = 'West';
    break;
   case 5:
    $gravity = 'Center';
    break;
   case 6:
    $gravity = 'East';
    break;
   case 7:
    $gravity = 'SouthWest';
    break;
   case 8:
    $gravity = 'South';
    break;
   case 9:
    $gravity = 'SouthEast';
    break;
  }
  $targetfile = !$preview ? $this->targetfile : DISCUZ_ROOT.'./forumdata/watermark_temp.jpg';
  if($watermarktype < 2) {
   $watermark_file = $watermarktype == 1 ? DISCUZ_ROOT.'./images/common/watermark.png' : DISCUZ_ROOT.'./images/common/watermark.gif';
   $exec_str = $imageimpath.'/composite'.
    ($watermarktype != 1 && $watermarktrans != '100' ? ' -watermark '.$watermarktrans.'%' : '').
    ' -quality '.$watermarkquality.
    ' -gravity '.$gravity.
    ' '.$watermark_file.' '.$this->targetfile.' '.$targetfile;
  } else {
   $watermarktextcvt = str_replace(array("n", "r", "'"), array('', '', '''), pack("H*", $watermarktext['text']));
   $watermarktext['angle'] = -$watermarktext['angle'];
   $translate = $watermarktext['translatex'] || $watermarktext['translatey'] ? ' translate '.$watermarktext['translatex'].','.$watermarktext['translatey'] : '';
   $skewX = $watermarktext['skewx'] ? ' skewX '.$watermarktext['skewx'] : '';
   $skewY = $watermarktext['skewy'] ? ' skewY '.$watermarktext['skewy'] : '';
   $exec_str = $imageimpath.'/convert'.
    ' -quality '.$watermarkquality.
    ' -font "'.$watermarktext['fontpath'].'"'.
    ' -pointsize '.$watermarktext['size'].
    (($watermarktext['shadowx'] || $watermarktext['shadowy']) && $watermarktext['shadowcolor'] ?
     ' -fill "rgb('.$watermarktext['shadowcolor'].')"'.
     ' -draw "'.
      ' gravity '.$gravity.$translate.$skewX.$skewY.
      ' rotate '.$watermarktext['angle'].
      ' text '.$watermarktext['shadowx'].','.$watermarktext['shadowy'].' ''.$watermarktextcvt.''"' : '').
    ' -fill "rgb('.$watermarktext['color'].')"'.
    ' -draw "'.
     ' gravity '.$gravity.$translate.$skewX.$skewY.
     ' rotate '.$watermarktext['angle'].
     ' text 0,0 ''.$watermarktextcvt.''"'.
    ' '.$this->targetfile.' '.$targetfile;
  }
  @exec($exec_str, $output, $return);
  if(empty($return) && empty($output)) {
   $this->attach['size'] = filesize($this->targetfile);
  }
 }
function Thumb_IM($thumbwidth, $thumbheight, $preview = 0) {
  global $thumbstatus, $imageimpath, $thumbquality;
  if($thumbstatus) {
   list($img_w, $img_h) = $this->attachinfo;
   $targetfile = !$preview ? ($thumbstatus == 1 || $thumbstatus == 3 ? $this->targetfile.'.thumb.jpg' : $this->targetfile) : DISCUZ_ROOT.'./forumdata/watermark_temp.jpg';
   if(!$this->animatedgif && ($img_w >= $thumbwidth || $img_h >= $thumbheight)) {
    if($thumbstatus != 3) {
     $exec_str = $imageimpath.'/convert -quality '.intval($thumbquality).' -geometry '.$thumbwidth.'x'.$thumbheight.' '.$this->targetfile.' '.$targetfile;
     @exec($exec_str, $output, $return);
     if(empty($return) && empty($output)) {
      $this->attach['thumb'] = $thumbstatus == 1 ? 1 : 0;
     }
    } else {
     $imgratio = $img_w / $img_h;
     $thumbratio = $thumbwidth / $thumbheight;
     if($imgratio >= 1 && $imgratio >= $thumbratio || $imgratio < 1 && $imgratio > $thumbratio) {
      $cuty = $img_h;
      $cutx = $cuty * $thumbratio;
     } elseif($imgratio >= 1 && $imgratio <= $thumbratio || $imgratio < 1 && $imgratio < $thumbratio) {
      $cutx = $img_w;
      $cuty = $cutx / $thumbratio;
     }
     $exec_str = $imageimpath.'/convert -crop '.$cutx.'x'.$cuty.'+0+0  '.$this->targetfile.' '.$targetfile;
     @exec($exec_str, $output, $return);
     $exec_str = $imageimpath.'/convert -quality '.intval($thumbquality).' -geometry '.$thumbwidth.'x'.$thumbheight.' '.$targetfile.' '.$targetfile;
     @exec($exec_str, $output, $return);
     if(empty($return) && empty($output)) {
      $this->attach['thumb'] = $thumbstatus == 1 || $thumbstatus == 3 ? 1 : 0;
     }
    }
             }
  }
 }

<?php php 验证码图片 程序
/*
*文件名:class.safeCode.php
*类名:safeCode
*目的:生成web应用时所需的验证码图片
*当前版本:1.0.2
*作者:NoAngels
*联系方式:flare_1023@163.com QQ:82535599 MSN:atizu@hotmail.com
*开发时间:2008年06月20日
*最后更新:2008年06月21日
*更新内容:
*版本1.0.2
*1.更新了对linux主机支持,设置GDFONTPATH环境变量,
* putenv('GDFONTPATH=' . realpath('.'));
*2.对不支持antialias函数的时候避免采用此方法,避免低版本的GD库
*版本1.0.1
*1.更新了绘制指定类型图片,支持类型有:png,jpeg,gif.默认为png(此效果最佳)
*2.优化了部分代码
*/
class safeCode{
        function __construct(){
                #设置默认safe安全保护码
                $this->__safe = substr(md5(time()), 0 , 4);
        }
        function __destruct(){
                #释放资源
                unset($this->__img, $this->__canvasWidth, $this->__canvasHeight, $this->__codeLength, $this->__spacePerChar, $this->__code, $this->__safe, $this->__background, $this->__borderColor, $this->__colors, $this->__font, $this->__sessionName);
        }
        function setCanvas($width = 200, $height = 60){
                #设置画布宽度以及高度.有默认值
                $this->__canvasWidth = $width;
                $this->__canvasHeight = $height;
                $this->__img = imagecreatetruecolor($width, $height);               
                return;
        }
        function setSafe($char){
                #设置安全码,不调用系统会自己设置
                $this->__safe = $char;
                return;
        }
        function setCodeLength($num = 8){
                #设置验证码长度
                $this->__codeLength = $num;
        }       
        function setFont($fontName){
                #设置绘图时所用的字体,字体文件必须与类文件同目录
                $this->__font = $fontName;
                return;
        }
        function setBackground($arg1 = 255, $arg2 = 255, $arg3 = 255){
                #设置背景颜色
                $this->__background = imagecolorallocate($this->__img, $arg1, $arg2, $arg3);
                return;
        }
        function setBorderColor($arg1 = 128, $arg2 = 128, $arg3 = 128){
                #设置边框颜色
                $this->__borderColor = imagecolorallocate($this->__img, $arg1, $arg2, $arg3);
        }
        function setFontColor($arr){
                #设置绘图时所用颜色,参数为颜色集合数组
                foreach($arr as $color){
                        $this->__colors[] = imagecolorallocate($this->__img, $color[0], $color[1], $color[2]);
                }
                return;
        }       
        function setSession($sessionName = 'safeCode'){
                #设置session变量名,默认为$_SESSION['safeCode']
                $this->__sessionName = $sessionName;
                #$_SESSION[$sessionName] = $this->__code;
                return;
        }
        function display($type = 'png'){
                #显示图片,可指定显示类型,目前支持png(默认),jpeg,gif
                $this->__setSpacePerChar();
                imagefilledrectangle($this->__img, 1, 1, $this->__canvasWidth - 2, $this->__canvasHeight -2, $this->__background);
                imagerectangle($this->__img, 0, 0, $this->__canvasWidth - 1, $this->__canvasHeight - 1, $this->__borderColor);
                $this->__drawText($this->__colors, $this->__getCode(), $this->__font);
                #修正linux以及低版本的GD库问题
                if(function_exists(imageantialias)){
                   imageantialias($this->__img, true);
                }
                $_SESSION[$this->__sessionName] = $this->__code;
                switch ($type){
                        case 'png':
                                header('Content-type:image/png');                               
                                imagepng($this->__img);       
                        case 'jpeg':
                                header('Content-type:image/jpeg');                               
                                imagejpeg($this->__img, '' , 75);
                        case 'gif':
                                header('Content-type:image/gif');                               
                                imagegif($this->__img);       
                        default:
                                header('Content-type:image/png');                               
                                imagepng($this->__img);                                                                                                               
                }
                imagegif($this->__img);       
        }       
        private function __setSpacePerChar(){
                #私有函数,设置字符间隔
                $this->__spacePerChar = $this->__canvasWidth / $this->__codeLength;
                return;
        }
        private function __getCode(){
                #获取验证码
                $this->__code = substr(md5(time().$this->__safe), rand(0, 24), $this->__codeLength);
                return $this->__code;
        }
        private function  __drawText($colors, $code, $fontName){
                #开始绘图
                #设置GBFONTPATH为当前目录,不然linux环境下会报错
                putenv('GDFONTPATH=' . realpath('.'));
                for($i = 0; $i < strlen($code); $i++){
                        $color = $colors[$i % count($colors)];
                        imagettftext(
                                $this->__img,
                                24 + rand(0, 8),
                                -20 + rand(0, 40),
                                ($i + 0.3) * $this->__spacePerChar,
                                $this->__canvasHeight - 20 + rand(0, 20),
                                $color,
                                $fontName,
                                $code{$i}
                        );
                }
                #绘制随机实线
                for($i = 0; $i < 400; $i++){
                        $x1 = rand(5, $this->__canvasWidth - 5);
                        $y1 = rand(5, $this->__canvasHeight - 5);
                        $x2 = $x1 - 4 + rand(0, 8);
                        $y2 = $y1 - 4 + rand(0, 8);
                        imageline($this->__img, $x1, $y1, $x2, $y2, $this->__colors[rand(0, count($this->__colors) - 1)]);
                }
                return;
        }
        private $__img = NULL;
        private $__canvasWidth = 120;
        private $__canvasHeight = 80;
        private $__codeLength = 8;
        private $__spacePerChar = 0;
        private $__code = 12345678;
        private $__safe = 2008;
        private $__background = NULL;
        private $__borderColor = NULL;       
        private $__colors = array();
        private $__font = 'arial.ttf';
        private $__sessionName = '';
}
?>

使用方法.

<?php
#测试文件
include_once('class.safeCode.php');
session_start();
$safeCode = new safeCode;
$safeCode->setCanvas(200, 50);
$safeCode->setCodeLength(8);
$safeCode->setSafe('2008');#设置安全码,不设置有默认值,动态生成
$safeCode->setBackground();
$safeCode->setBorderColor();
$safeCode->setFont('arial.ttf');#设置字体.必须同目录,字体文件
$colors = array(array(128, 64, 192), array(192, 64, 128), array(108, 192, 64));
$safeCode->setFontColor($colors);
$safeCode->setSession();
$safeCode->display('jpeg');

?>

php 生成验证码程序

<?php
$consts = 'bcdfghjkmnpqrstwxyz';
 $vowels = 'aei23456789';
 for ($x = 0; $x < 6; $x++)
 {
  $const[$x] = substr($consts, mt_rand(0,strlen($consts)-1),1);
  $vow[$x] = substr($vowels, mt_rand(0,strlen($vowels)-1),1);
 }
 $radomstring = $const[0] . $vow[0] .$const[2] . $const[1] . $vow[1] . $const[3] . $vow[3] . $const[4];
 $_SESSION['checkcode'] = $string = substr($radomstring,0,4); //only display 4 str
 / t up image, the first number is the width and the second is the height
 $imageX = strlen($radomstring)*5.5; //the image width
 $imageY = 20;      //the image height
 $im = imagecreatetruecolor($imageX,$imageY);

 //creates two variables to store color
 $background = imagecolorallocate($im, rand(180, 250), rand(180, 250), rand(180, 250));
 $foregroundArr = array(imagecolorallocate($im, rand(0, 20), rand(0, 20), rand(0, 20)),
         imagecolorallocate($im, rand(0, 20), rand(0, 10), rand(245, 255)),
         imagecolorallocate($im, rand(245, 255), rand(0, 20), rand(0, 10)),
         imagecolorallocate($im, rand(245, 255), rand(0, 20), rand(245, 255)));
 $foreground2 = imagecolorallocatealpha($im, rand(20, 100), rand(20, 100), rand(20, 100),80);  
 $middleground = imagecolorallocate($im, rand(200, 160), rand(200, 160), rand(200, 160));
 $middleground2 = imagecolorallocatealpha($im, rand(180, 140), rand(180, 140), rand(180, 140),80);

 //fill image with bgcolor
 imagefill($im, 0, 0, imagecolorallocate($im, 250, 253, 254));
 //writes string
 imagestring($im, 5, 3, floor(rand(0,5))-1, $string[0], $foregroundArr[rand(0,3)]);
 imagestring($im, 5, 13, floor(rand(0,5))-1, $string[1], $foregroundArr[rand(0,3)]);
 imagestring($im, 5, 23, floor(rand(0,5))-1, $string[2], $foregroundArr[rand(0,3)]);
 imagestring($im, 5, 33, floor(rand(0,5))-1, $string[3], $foregroundArr[rand(0,3)]);
 for($i=0; $i<strlen($string); $i++)
 {
  if(mt_rand(0,ord(substr($string,$i,1)))%2 == 0)
  {
   $string{$i} = ' ';
  }
 }
 imagestring($im, 2, 2, 0, $string, $foreground2);
 //strikethrough

 $border = imagecolorallocate($im, 133, 153, 193);
 //imagefilledrectangle($aimg, 0, 0, $x_size - 1, $y_size - 1, $back);
 imagerectangle($im, 0, 0, $imageX - 1, $imageY - 1, $border);

 $pointcol = imagecolorallocate($im, rand(0,255), rand(0,255), rand(0,255));
 for ($i=0;$i<20;$i++)
 {
  imagesetpixel($im,rand(2,$imageX-2),rand(2,$imageX-2),$pointcol);
 }
 //rotate

 $middleground = imagecolorallocatealpha($im, rand(160, 200), rand(160, 200), rand(160, 200), 80);
 //random shapes
 for ($x=0; $x<15;$x++)
 {
  if(mt_rand(0,$x)%2==0)
  {
   imageline($im, rand(0, 120), rand(0, 120), rand(0, 120), rand(0, 120), $middleground);
   imageellipse($im, rand(0, 120), rand(0, 120), rand(0, 120), rand(0, 120), $middleground2);
  }
  else
  {
   imageline($im, rand(0, 120), rand(0, 120), rand(0, 120), rand(0, 120), $middleground2);
   imageellipse($im, rand(0, 120), rand(0, 120), rand(0, 120), rand(0, 120), $middleground);
  }
 }
 //output to browser
    header("content-type:image/png\r\n");
 imagepng($im);
 imagedestroy($im);
?>

php 图片 中文验证码

<img src="verify_image.php" alt="点此刷新验证码" name="verify_code" width="65" height="20" border="0" id="verify_code" onclick="document.getElementById('verify_code').src='verify_image.php?'+Math.random();" style="cursor:pointer;" />

<?php
session_start();

$vi = new vCodeImage;
$vi->SetImage(1,4,65,20,80,1);

class vCodeImage{
 var $mode;  //1:数字模式,2:字母模式,3:数字字母模式,其他:数字字母优化模式
 var $v_num;  //验证码个数
 var $img_w;  //验证码图像宽度
 var $img_h;  //验证码图像高度
 var $int_pixel_num;  //干扰像素个数
 var $int_line_num;  //干扰线条数
 var $font_dir;   //字体文件相对路径
 var $border;   //图像边框
 var $borderColor;  //图像边框颜色

 function SetImage($made,$v_num,$img_w,$img_h,$int_pixel_num,$int_line_num,$font_dir='../font',$border=true,$borderColor='255,200,85'){
  if(!isset($_SESSION['vCode'])){
   session_register('vCode');
  }
  $_SESSION['vCode']="";
 
  $this->mode = $made;
  $this->v_num = $v_num;
  $this->img_w = $img_w;
  $this->img_h = $img_h;
  $this->int_pixel_num = $int_pixel_num;
  $this->int_line_num = $int_line_num;
  $this->font_dir = $font_dir;
  $this->border = $border;
  $this->borderColor = $borderColor;
  $this->GenerateImage();
 }

 function GetChar($mode){
  if($mode == "1"){
   $ychar = "0,1,2,3,4,5,6,7,8,9";
  }
  else if($mode == "2"){
   $ychar = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
  }
  else if($mode == "3"){
   $ychar = "0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
  }
  else
   $ychar = "3,4,5,6,7,8,9,A,B,C,D,H,K,P,R,S,T,W,X,Y";
  return $ychar;
 }
 
 function RandColor($rs,$re,$gs,$ge,$bs,$be){
  $r = mt_rand($rs,$re);
  $g = mt_rand($gs,$ge);
  $b = mt_rand($bs,$be);
  return array($r,$g,$b);
 }
 
 function GenerateImage(){
  $im = imagecreate($this->img_w,$this->img_h);

  $black = imagecolorallocate($im, 0,0,0);
  $white = imagecolorallocate($im, 255,255,255);
  $bgcolor = imagecolorallocate($im, 250,250,250);

  imagefill($im,0,0,$bgcolor);

  $fonts = ScanDir($this->font_dir);
  $fmax = count($fonts) - 2;

  $ychar = $this->GetChar($this->mode);
  $list = explode(",",$ychar);

  $x = mt_rand(2,$this->img_w/($this->v_num+2));
  $cmax = count($list) - 1;

  $v_code = '';

  for($i=0;$i<$this->v_num;$i++) //验证码
  {
   $randnum = mt_rand(0,$cmax);
   $this_char = $list[$randnum];
   $v_code .= $this_char;
   $size = mt_rand(intval($this->img_w/5),intval($this->img_w/4));
   $angle = mt_rand(-20,20);
   $y = mt_rand(($size+2),($this->img_h-2));
   if($this->border)
    $y = mt_rand(($size+3),($this->img_h-3));
   $rand_color = $this->RandColor(0,200,0,100,0,250);
   $randcolor = imagecolorallocate($im,$rand_color[0],$rand_color[1],$rand_color[2]);
   $fontrand = mt_rand(2, $fmax);
   $font = "$this->font_dir/".$fonts[$fontrand];
   imagettftext($im, $size, $angle, $x, $y, $randcolor, $font, $this_char);
   $x = $x + intval($this->img_w/($this->v_num+1));
  }

  for($i=0;$i<$this->int_pixel_num;$i++){//干扰像素
   $rand_color = $this->RandColor(50,250,0,250,50,250);
   $rand_color_pixel = imagecolorallocate($im,$rand_color[0],$rand_color[1],$rand_color[2]);
   imagesetpixel($im, mt_rand()%$this->img_w, mt_rand()%$this->img_h, $rand_color_pixel);
  }

  for($i=0;$i<$this->int_line_num;$i++){ //干扰线
   $rand_color = $this->RandColor(0,250,0,250,0,250);
   $rand_color_line = imagecolorallocate($im,$rand_color[0],$rand_color[1],$rand_color[2]);
   imageline($im, mt_rand(0,intval($this->img_w/3)), mt_rand(0,$this->img_h), mt_rand(intval($this->img_w - ($this->img_w/3)),$this->img_w), mt_rand(0,$this->img_h), $rand_color_line);
  }

  if($this->border) //画出边框
  {
   if(preg_match("/^\d{1,3},\d{1,3},\d{1,3}$/",$this->borderColor)){
    $borderColor = explode(',',$this->borderColor);
   }
   $border_color_line = imagecolorallocate($im,$borderColor[0],$borderColor[1],$borderColor[2]);
   imageline($im, 0, 0, $this->img_w, 0, $border_color_line); //上横
   imageline($im, 0, 0, 0, $this->img_h, $border_color_line); //左竖
   imageline($im, 0, $this->img_h-1, $this->img_w, $this->img_h-1, $border_color_line); //下横
   imageline($im, $this->img_w-1, 0, $this->img_w-1, $this->img_h, $border_color_line); //右竖
  }

  imageantialias($im,true); //抗锯齿

  $time = time();
  $_SESSION['vCode'] = $v_code."|".$time; //把验证码和生成时间负值给$_SESSION[vCode]

  //生成图像给浏览器
  if (function_exists("imagegif")) {
      header ("Content-type: image/gif");
      imagegif($im);
  }
  elseif (function_exists("imagepng")) {
      header ("Content-type: image/png");
      imagepng($im);
  }
  elseif (function_exists("imagejpeg")) {
      header ("Content-type: image/jpeg");
      imagejpeg($im, "", 80);
  }
  elseif (function_exists("imagewbmp")) {
      header ("Content-type: image/vnd.wap.wbmp");
      imagewbmp($im);
  }
  else
      die("No Image Support On This Server !");
 
  imagedestroy($im);
 }
}
?>

[!--infotagslink--]

相关文章

  • php正确禁用eval函数与误区介绍

    eval函数在php中是一个函数并不是系统组件函数,我们在php.ini中的disable_functions是无法禁止它的,因这他不是一个php_function哦。 eval()针对php安全来说具有很...2016-11-25
  • php中eval()函数操作数组的方法

    在php中eval是一个函数并且不能直接禁用了,但eval函数又相当的危险了经常会出现一些问题了,今天我们就一起来看看eval函数对数组的操作 例子, <?php $data="array...2016-11-25
  • 使用PHP+JavaScript将HTML页面转换为图片的实例分享

    这篇文章主要介绍了使用PHP+JavaScript将HTML元素转换为图片的实例分享,文后结果的截图只能体现出替换的字体,也不能说将静态页面转为图片可以加快加载,只是这种做法比较interesting XD需要的朋友可以参考下...2016-04-19
  • Python astype(np.float)函数使用方法解析

    这篇文章主要介绍了Python astype(np.float)函数使用方法解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下...2020-06-08
  • C#从数据库读取图片并保存的两种方法

    这篇文章主要介绍了C#从数据库读取图片并保存的方法,帮助大家更好的理解和使用c#,感兴趣的朋友可以了解下...2021-01-16
  • Photoshop古装美女图片转为工笔画效果制作教程

    今天小编在这里就来给各位Photoshop的这一款软件的使用者们来说说把古装美女图片转为细腻的工笔画效果的制作教程,各位想知道方法的使用者们,那么下面就快来跟着小编一...2016-09-14
  • Python 图片转数组,二进制互转操作

    这篇文章主要介绍了Python 图片转数组,二进制互转操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-03-09
  • Python中的imread()函数用法说明

    这篇文章主要介绍了Python中的imread()函数用法说明,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2021-03-16
  • php抓取网站图片并保存的实现方法

    php如何实现抓取网页图片,相较于手动的粘贴复制,使用小程序要方便快捷多了,喜欢编程的人总会喜欢制作一些简单有用的小软件,最近就参考了网上一个php抓取图片代码,封装了一个php远程抓取图片的类,测试了一下,效果还不错分享...2015-10-30
  • C# 中如何取绝对值函数

    本文主要介绍了C# 中取绝对值的函数。具有很好的参考价值。下面跟着小编一起来看下吧...2020-06-25
  • C#学习笔记- 随机函数Random()的用法详解

    下面小编就为大家带来一篇C#学习笔记- 随机函数Random()的用法详解。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧...2020-06-25
  • jquery左右滚动焦点图banner图片鼠标经过显示上下页按钮

    jquery左右滚动焦点图banner图片鼠标经过显示上下页按钮...2013-10-13
  • 利用JS实现点击按钮后图片自动切换的简单方法

    下面小编就为大家带来一篇利用JS实现点击按钮后图片自动切换的简单方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧...2016-10-25
  • 金额阿拉伯数字转换为中文的自定义函数

    CREATE FUNCTION ChangeBigSmall (@ChangeMoney money) RETURNS VarChar(100) AS BEGIN Declare @String1 char(20) Declare @String2 char...2016-11-25
  • Photoshop枪战电影海报图片制作教程

    Photoshop的这一款软件小编相信很多的人都已经是使用过了吧,那么今天小编在这里就给大家带来了用Photoshop软件制作枪战电影海报的教程,想知道制作步骤的玩家们,那么下面...2016-09-14
  • Android开发中findViewById()函数用法与简化

    findViewById方法在android开发中是获取页面控件的值了,有没有发现我们一个页面控件多了会反复研究写findViewById呢,下面我们一起来看它的简化方法。 Android中Fin...2016-09-20
  • C++中 Sort函数详细解析

    这篇文章主要介绍了C++中Sort函数详细解析,sort函数是algorithm库下的一个函数,sort函数是不稳定的,即大小相同的元素在排序后相对顺序可能发生改变...2022-08-18
  • js实现上传图片及时预览

    这篇文章主要为大家详细介绍了js实现上传图片及时预览的相关资料,具有一定的参考价值,感兴趣的朋友可以参考一下...2016-05-09
  • PHP用strstr()函数阻止垃圾评论(通过判断a标记)

    strstr() 函数搜索一个字符串在另一个字符串中的第一次出现。该函数返回字符串的其余部分(从匹配点)。如果未找到所搜索的字符串,则返回 false。语法:strstr(string,search)参数string,必需。规定被搜索的字符串。 参数sea...2013-10-04
  • PHP函数分享之curl方式取得数据、模拟登陆、POST数据

    废话不多说直接上代码复制代码 代码如下:/********************** curl 系列 ***********************///直接通过curl方式取得数据(包含POST、HEADER等)/* * $url: 如果非数组,则为http;如是数组,则为https * $header:...2014-06-07