PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How can I find the width and height of an image resource?


It is often useful to know the width and height of an image resource. This can be achieved with the functions imagesx and imagesy, like this:

<?php
$img 
imagecreatetruecolor(400100);
echo 
imagesx($img); // 400
echo imagesy($img); // 100
?>





More images PHP Questions

How can I add text to an image?
How can I find the colour of a pixel of an image?
How can I rotate an image?