小编use*_*958的帖子

图像上的中心水印

我需要在图像上添加水印.我已经解决了使用此代码,运行良好,但图像位于左/下角.如何在图像中心设置中心水印?

$img = 'test.jpg';
// Load the image where the logo will be embeded into
$image = imagecreatefromjpeg($img);


// Load the logo image
$logoImage = imagecreatefrompng("watermark.png");
imagealphablending($logoImage, true);

// Get dimensions
$imageWidth=imagesx($image);
$imageHeight=imagesy($image);

$logoWidth=imagesx($logoImage);
$logoHeight=imagesy($logoImage);     

// Paste the logo
imagecopy(
   // destination
   $image, 
   // source
   $logoImage, 
   // destination x and y 
   $imageWidth-$logoWidth, $imageHeight-$logoHeight,    
   // source x and y
   0, 0,
   // width and height of the area of the source to copy
   $logoWidth, $logoHeight);

// Set type of image and …
Run Code Online (Sandbox Code Playgroud)

php

3
推荐指数
1
解决办法
5996
查看次数

在日期之间创建仅包含最后修改过的文件的ZIP/RAR文件(WINDOWS)

我修改了一些php代码文件,它们是一个项目的一部分,它位于一个包含子目录的目录中.现在我想发送一个zip文件,其中只包含最后修改过的文件给另一个人.喜欢:

/c/index.php

/c/out/inc_out.php

/sales.php

有没有一种简单的方法来选择日期范围并使用最新修改的文​​件创建ZIP/RAR存档?我在Windows上.

php windows zip rar

3
推荐指数
1
解决办法
2749
查看次数

使用IF条件重定向用户

我想使用此IF根据权限重定向用户.但用户始终被重定向到仪表板.

其实我已经设定:

$perm_edit = '0';
$user_level = '1';

if ($perm_edit !== 1 || $user_level !== 1) {
      header("Location: $url/dash.php?error=1"); exit;
 }
Run Code Online (Sandbox Code Playgroud)

|| 运营商只需要一个条件.

我错了什么?

php

0
推荐指数
1
解决办法
49
查看次数

标签 统计

php ×3

rar ×1

windows ×1

zip ×1