PHP Classes

File: test_img_info.php

Recommend this page to a friend!
  Classes of Mike Jordan  >  PHP Image cURL  >  test_img_info.php  >  Download  
File: test_img_info.php
Role: Example script
Content type: text/plain
Description: Demo script
Class: PHP Image cURL
Emulate getimagesize function remotely using cURL
Author: By
Last change: Updated demo
Date: 6 years ago
Size: 342 bytes
 

Contents

Class file image Download
<?php

include 'img_info.php';
 
$info = img_info::getimagesize( 'http://some_site.com/dir/image.jpg' );
 
if ( !
$info )
   echo
'invalid image or URL';
else
  
print_r( $info );

//Returns: Array ( [0] => 80 [1] => 60 [2] => 2 [3] => width="80" height="60" [bits] => 8 [channels] => 3 [mime] => image/jpeg [size] => 1954 )
 
?>