imageflip() function in PHP

The imageflip() function is used to flip an image using given mode.

Syntax

bool imageflip(img, mode )

Parameters

  • img: An image resource created using imagecreatetruecolor()

  • mode: The flip mode. Here are the possible values:

  • IMG_FLIP_HORIZONTAL – Flips the image horizontally.

  • IMG_FLIP_VERTICAL – Flips the image vertically.

  • IMG_FLIP_BOTH – Flips the image both horizontally and vertically.

Return

The imageflip() function returns TRUE on success or FALSE on failure.

Example

The following is an example that flips an image horizontally:

Output

The following is the output:

Updated on: 2019-12-31T07:18:28+05:30

340 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements