getimagesize()Functionis used to obtain the image size and related information. It returns anarrayif successful. If it fails, it returns FALSE and generates an E_WARNING levelerror message. The following is an example of the getimagesize() function
"; echo ""; ?>
Get the image name, pathinfo() function, this can also get the extension of other files.
$a = 'aaaaa.jpg'; print_r(pathinfo($a));
Run result:
Array ( [dirname] => . [basename] => aaaaa.jpg [extension] => jpg [filename] => aaaaa )
The above is the detailed content of Detailed explanation of method examples of obtaining image information in php. For more information, please follow other related articles on the PHP Chinese website!