[php]getimagesize — 取得圖像大小


官方範例1
<?php
list($width, $height, $type, $attr) = getimagesize("img/flag.jpg");
echo "<img src=\"img/flag.jpg\" $attr>";
?>


URL 支持是 PHP 4.0.5 添加的。
官方範例2
<?php
$size = getimagesize("http://www.example.com/gifs/logo.gif");


// if the file name has space in it, encode it properly
$size = getimagesize("http://www.example.com/gifs/lo%20go.gif");


?>

arrow
arrow
    全站熱搜

    stockwfj3 發表在 痞客邦 留言(0) 人氣()