PHP中的imageflip()未定义

PHP中的imageflip()未定义,php,image,image-rotation,php-ini,Php,Image,Image Rotation,Php Ini,每当我尝试使用函数imageflip(),它都会显示以下消息 致命错误:在第6行的D:\xampp\htdocs\temp1\image\u flip.php中调用未定义的函数imageflip() 调用imap\u open函数后,我已经安装了imap扩展并配置了所有。但是,它仍然显示相同的消息。imageflip()仅在之后可用。但是,正如前面所解释的,您仍然可以自己定义它(尽管如果您计划升级到PHP5.5,不建议实现您的,或者至少更改名称以避免重复问题)。为了避免stackoverflow

每当我尝试使用函数
imageflip()
,它都会显示以下消息

致命错误:在第6行的
D:\xampp\htdocs\temp1\image\u flip.php中调用未定义的函数
imageflip()

调用
imap\u open
函数后,我已经安装了imap扩展并配置了所有。但是,它仍然显示相同的消息。

imageflip()
仅在之后可用。但是,正如前面所解释的,您仍然可以自己定义它(尽管如果您计划升级到PHP5.5,不建议实现您的,或者至少更改名称以避免重复问题)。为了避免stackoverflow,我将代码粘贴到这里:

<?php

/**
 * Flip (mirror) an image left to right.
 *
 * @param image  resource
 * @param x      int
 * @param y      int
 * @param width  int
 * @param height int
 * @return bool
 * @require PHP 3.0.7 (function_exists), GD1
 */
function imageflip(&$image, $x = 0, $y = 0, $width = null, $height = null)
{
    if ($width  < 1) $width  = imagesx($image);
    if ($height < 1) $height = imagesy($image);
    // Truecolor provides better results, if possible.
    if (function_exists('imageistruecolor') && imageistruecolor($image))
    {
        $tmp = imagecreatetruecolor(1, $height);
    }
    else
    {
        $tmp = imagecreate(1, $height);
    }
    $x2 = $x + $width - 1;
    for ($i = (int) floor(($width - 1) / 2); $i >= 0; $i--)
    {
        // Backup right stripe.
        imagecopy($tmp,   $image, 0,        0,  $x2 - $i, $y, 1, $height);
        // Copy left stripe to the right.
        imagecopy($image, $image, $x2 - $i, $y, $x + $i,  $y, 1, $height);
        // Copy backuped right stripe to the left.
        imagecopy($image, $tmp,   $x + $i,  $y, 0,        0,  1, $height);
    }
    imagedestroy($tmp);
    return true;
}

<?php

$image = imagecreate(190, 60);
$background = imagecolorallocate($image, 100, 0,   0);
$color      = imagecolorallocate($image, 200, 100, 0);
imagestring($image, 5, 10, 20, "imageflip() example", $color);
imageflip($image);
header("Content-Type: image/jpeg");
imagejpeg($image);