
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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:
<?php $img_file = 'http://www.tutorialspoint.com/images/tp-logo-diamond.png'; header('Content-type: image/png'); $img = imagecreatefrompng($img_file); imageflip($img, IMG_FLIP_HORIZONTAL); imagejpeg($img); imagedestroy($img); ?>
Output
The following is the output:
Advertisements