Get image width in PHP

Description

The following code shows how to get image width.

Example


<?php// ww  w  . j a v  a 2  s .  com

// create a 300*200 image
$img = imagecreatetruecolor(300, 200);

echo imagesx($img); // 300

?>

The code above generates the following result.

Get image width in PHP




















Home »
  PHP Tutorial »
    Image »




Color
Create
Font
Operation
Shape
Text