Truemag

  • Categories
    • Tips And Tricks
    • Internet
    • PHP
    • Javascript
    • CSharp
    • SQL Server
    • Linux
  • Lastest Videos
  • Our Demos
  • About
  • Contact
  • Home
  • Write With Us
  • Job Request
Home PHP PHP Get Remote Image Width Height

PHP Get Remote Image Width Height

In order to get Width x Height of a remote image via its URL with PHP, we can use getimagesize() function. It also returns file type and sizes of the remote image.

Of course, this function works well with local image

Get Remote Image Width Height

<?php
list($width, $height) = getimagesize("http://cdn1.4rapiddev.com/wp-content/uploads/2011/04/Microsoft-SQL-Server-2008-Shrink.jpg"); 
echo "width: " . $width . " px" . "<br>";
echo "height: " . $height . " px" . "<br>";
?>

<?php list($width, $height) = getimagesize("http://cdn1.4rapiddev.com/wp-content/uploads/2011/04/Microsoft-SQL-Server-2008-Shrink.jpg"); echo "width: " . $width . " px" . "<br>"; echo "height: " . $height . " px" . "<br>"; ?>

Output

width: 648 px
height: 415 px

width: 648 px height: 415 px

Feb 15, 2012Hoan Huynh
JQuery Get selected value of radio buttonPHP Get Remote File Size And Content Type
You Might Also Like:
  • Get Image Width Height With JQuery And JavaScript
  • PHP Get Image Width And Height
  • How To Track Website With Multiple Google Analytisc Accounts
  • Facebook Like Button And Recommend Button With fb:like, iframe and html5
  • Jquery checkbox checked
  • PHP Get Remote File Size And Content Type
  • Javascript Problem Set focus textbox on Firefox
  • PHP SSH To Remote Server And Execute Command
  • MacBook Remote Desktop To A Windows Based Computer
  • JavaScript Get Radio Button Value
Hoan Huynh

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at [email protected]

9 years ago PHPGetImageSize386
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Most Viewed
PHP Download Image Or File From URL
22,210 views
Notepad Plus Plus Compare Plugin
How To Install Compare Text Plugin In Notepad Plus Plus
20,077 views
Microsoft SQL Server 2008 Attach Remove Log
Delete, Shrink, Eliminate Transaction Log .LDF File
15,854 views
JQuery Allow only numeric characters or only alphabet characters in textbox
13,334 views
C# Read Json From URL And Parse/Deserialize Json
9,828 views
4 Rapid Development is a central page that is targeted at newbie and professional programmers, database administrators, system admin, web masters and bloggers.
Recent Posts
  • Photo Editor App – How Good Is it?

  • The Best Way To Write An Essay – Creating A Good Essay
  • Free Online Photo Editor
  • Easy Tips For Writing An Essay
  • What Can I Expect From An Academic Essay Service?

Categories
  • CSharp (45)
  • Facebook Graph API (19)
  • Google API (7)
  • Internet (87)
  • iPhone XCode (8)
  • Javascript (35)
  • Linux (28)
  • MySQL (16)
  • PHP (84)
  • Problem Issue Error (29)
  • Resources (32)
  • SQL Server (25)
  • Timeline (5)
  • Tips And Tricks (141)
  • Uncategorized (114)
Recommended
  • Custom Software Development Company
  • Online Useful Tools
  • Premium Themes
  • VPS
2014 © 4 Rapid Development