Home  >  Article  >  Backend Development  >  Detailed explanation of method examples of obtaining image information in php

Detailed explanation of method examples of obtaining image information in php

怪我咯
怪我咯Original
2017-07-14 11:18:492670browse

getimagesize() Function is used to obtain the image size and related information. It returns an array if successful. If it fails, it returns FALSE and generates an E_WARNING level error 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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn