array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.image-type-to-extension.php', 1 => 'image_type_to_extension', ), 'up' => array ( 0 => 'ref.image.php', 1 => 'GD ve Görüntü İşlevleri', ), 'prev' => array ( 0 => 'function.getimagesizefromstring.php', 1 => 'getimagesizefromstring', ), 'next' => array ( 0 => 'function.image-type-to-mime-type.php', 1 => 'image_type_to_mime_type', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'tr', 'path' => 'reference/image/functions/image-type-to-extension.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.2.0, PHP 7, PHP 8)
image_type_to_extension — Resim türü ile ilgili dosya uzantısını döndürür
IMAGETYPE_XXX
sabiti ile ilgili dosya uzantısını döndürür.
resim_türü
IMAGETYPE_XXX
sabitlerinden biri.
notkalı
Uzantıya bir nokta eklenip eklenmeyeceği belirtilir. true
öntanımlıdır.
Belirtilen resim türü ile ilgili dosya uzantısını bir dizge olarak
döndürür, başarısızlık durumunda false
döner.
Örnek 1 - image_type_to_extension() örneği
<?php
// Boş bir resim oluşturalım
$resim = imagecreatetruecolor(100, 100);
// Resmi kaydedelim
imagepng($resim, './dnm' . image_type_to_extension(IMAGETYPE_PNG));
imagedestroy($resim);
?>
Bilginize:
Bu işlev için GD görüntü kütüphanesi gerekli değildir.