![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
getimagesize() function in PHP
The getimagesize() function is used to display the size of an image.
Syntax
getimagesize(file_name, img_info)
Parameters
file_name: The file image i.e. the image path.
img_info: Extract some extended information from the image file. Supports only JFIF files.
Return
The getimagesize() function returns an array element with height, width, type, MIME type of the image, etc.
Example
The following is an example:
<?php $image_info = getimagesize("http://www.tutorialspoint.com/images/tp-logo-diamond.png"); print_r($image_info); ?>
Output
The following is the output:
Array ( [0] => 205 [1] => 120 [2] => 3 [3] => width="205" height="120" [bits] => 8 [mime] => image/png)
Advertisements