|
 |
|
ย่อขนาดภาพ ตอนแสดงผล...เราทำเวบบอร์ดค่ะ แล้วก็มีให้อัพโหลดภาพ แล้วมาโชว์ ทีนี้เนี่ย ถ้าภาพที่มี |
|
 |
|
|
 |
 |
|
$size = getimagesize("images/abc.jpg");
if($size > 200)
echo "<img src=\"images/abc.jpg\" width="200">
else
echo "<img src=\"images/abc.jpg\">
ให้ไอเดีย ถ้าไม่อยากใช้ code resize รูปก็ getsize มันเอา
|
 |
 |
 |
 |
Date :
2009-03-25 22:26:07 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<?php
list($width, $height, $type, $attr) = getimagesize("image_name.jpg");
echo "Image width " .$width;
echo "<BR>";
echo "Image height " .$height;
echo "<BR>";
echo "Image type " .$type;
echo "<BR>";
echo "Attribute " .$attr;
?>
ได้ค่า width height แล้วเอาไป if
|
 |
 |
 |
 |
Date :
2009-03-25 22:26:13 |
By :
helpmeplz |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อืมมม ถามเองตอบเอง เจ๋งๆ
|
 |
 |
 |
 |
Date :
2009-03-25 22:33:22 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
555+
จิงด้วย
|
 |
 |
 |
 |
Date :
2009-03-25 23:36:16 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|