What command can be used to determine the size and dimensions of an uploaded image in PHP?
To determine the size and dimensions of an uploaded image in PHP, you can use the getimagesize() function. This function returns an array containing the image width, height, type, and attributes. By using this function, you can easily retrieve the dimensions of the uploaded image and perform any necessary validation or processing based on the size.
$uploaded_file = $_FILES['file']['tmp_name'];
$image_info = getimagesize($uploaded_file);
$image_width = $image_info[0];
$image_height = $image_info[1];
echo "Image Width: " . $image_width . "px<br>";
echo "Image Height: " . $image_height . "px";