Ben değişkenleri bildirir bu işlevi vardır:
function imageSize($name, $nr, $category){
$path = 'ad_images/'.$category.'/'.$name.'.jpg';
$path_thumb = 'ad_images/'.$category.'/thumbs/'.$name.'.jpg';
list($width, $height) = getimagesize($path);
list($thumb_width, $thumb_height) = getimagesize($path_thumb);
${'thumb_image_' . $nr . '_width'} = $thumb_width;
${'thumb_image_' . $nr . '_height'} = $thumb_height;
${'image_' . $nr . '_width'} = $width;
${'image_' . $nr . '_height'} = $height;
}
Ben bu echo zaman:
echo $image_1_width
Gayet iyi çalışıyor, ama alışkanlık değişkeni tanımıyor işlevi DIŞ yaparsanız, nasıl bir şekilde onları 'küresel' yapabilir?
Teşekkürler