What function in PHP can be used to determine the height and width of an image?
To determine the height and width of an image in PHP, you can use the `getimagesize()` function. This function returns an array containing the dimensions of the image (width and height) as well as other information such as image type and attributes. By using `getimagesize()`, you can easily retrieve the height and width of an image for further processing or display.
$image_path = 'path/to/your/image.jpg';
$dimensions = getimagesize($image_path);
$width = $dimensions[0];
$height = $dimensions[1];
echo "Image width: $width pixels<br>";
echo "Image height: $height pixels";
Related questions
-
sort() function PHP
-
XHTML XSLT HTML content
-
PHP JavaScript dynamic