简体   繁体   English

检查图像在PHP的大小?

[英]checking an image for size in php?

i want to check an images size thats already uploaded to the server: psuedocode 我想检查已上传到服务器的图像大小:psuedocode

if (checksize($image) >10mb {

die

}

can i do something like that in php? 我可以在php中做类似的事情吗? thanks :)_) 谢谢 :)_)

Assuming $image is a path to a file somewhere on the filesystem: 假设$image是文件系统上某个文件的路径:

if(filesize($image) > (10 * 1024 * 1024)){  // is it larger than 10mb?
   die('too big');
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM