Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我读过phpmanual。我遇到的问题是限制要上传的图像的宽度和高度...边界$w=200,$h=100。任何人都可以帮助我..?
如果没有更多细节,我们无法告诉您太多,但这应该足以让您入门。
这是获取图像尺寸所需的基本逻辑,由您在 if 块中做一些有用的事情。
$maxWidth = 100; $maxHeight = 100; list($width, $height) = getimagesize('image.jpg'); if ($width > $maxWidth || $height > $maxHeight) { // Cancel upload }