PHP

PHP image Flip

Following code will  flip image in vertical/horizontal/both

$imageSrc = imagecreatefrompng(SOURCE_IMAGE_PATH);

$imageSrc = ImageFlip($imageSrc, 3);

imagepng($imageSrc, 'flip.png');

imagedestroy($imageSrc);
/**
 * $imgSrc
 * Image source
 *
 * $mode
 * 1 = vertical
 * 2 = horizontal
 * 3 = both
 */
function ImageFlip($imgSrc, $mode) {

  $width = imagesx($imgSrc);
  $height = imagesy($imgSrc);