image_type_to_extension

(PHP 5 >= 5.2.0, PHP 7)

image_type_to_extensionObtiene la extensión de un tipo de imagen

Descripción

string image_type_to_extension ( int $imagetype [, bool $include_dot = TRUE ] )

Devuelve la extensión de la constante IMAGETYPE_XXX dada.

Parámetros

imagetype

Una de las constantes IMAGETYPE_XXX.

include_dot

Si le antecede un punto a la extensión. Por defecto es TRUE.

Valores devueltos

Una cadena con la extensión correspondiente al tipo de imagen dado.

Ejemplos

Ejemplo #1 Ejemplo de image_type_to_extension()

<?php
// Crear una instancia de imagen
$im imagecreatetruecolor(100100);

// Guardar imagen
imagepng($im'./prueba' image_type_to_extension(IMAGETYPE_PNG));
imagedestroy($im);
?>

Notas

Nota:

Esta función no requiere la librería GD image.

add a note

aref=="note"r /&nbuts"="/" cl#69994<> &>Est; ared="b="titledtype=""PHP R2006-09-28 09:10rong>image11 ybsps agoong>

lang> To: php' at spycrumksoatspa>

u.php fectypeu.php p
class="dc-titt"> D/// Dt"> rnvaluee="heltffecies">id typen
D### ThSimps"> espondienteop D###; D###; D###; D###; D###; D###; D###; D###; D###; D### 10 = JP2n D### 11 = JPX; D### 12 = JB2; D### 13 = SWC; D### 14 = IFFn D### 15 = WBMPn D### 16 = XBM> D// -1nbecaote $_type_to_extiont) D// Rvalueetrin loop d Ar match> D// ng C nvcor of/sion - Matffectype box" n D// Found matchequineedop D### Rvaluen D// essiar an llps"> eXForout match>
Notafunct69992

.php?sect=rea69992perm=eunction.image-type-to-extension">Repperm=v> =utle="PHP RVlassup!ss="refenotes"> <-v> u">up

.php?sect=rea69992perm=eunction.image-type-to-extension">Repperm=v> =oadsle="PHP RVlassoads!ss="refenotes"> <-v>

aref=="note"r /&nbuts"="/" cl#69992<> &>Est; ared="b="titledtype=""PHP R2006-09-28 07:55rong>image11 ybsps agoong>

lang> 2006-09-29>
(g'op s below). That' eXhy I wrlassmypads ype t()" nteeop s, php.s" idd fecimprove> s woulenbe gr
in yleon.onvont)php'od="getop !). Als cxten(It le s .php's nvaliseu.hat a tt"> i.s" iiere lrdd fecat worsttffeg
.hat i.sundp' your cl Extenthe nisk of/ leerrfecby ttterminnd Gthe nts"> eu.hat a Outpu.php fecroce sion - Ma i espondcttffecit' eheaoci/atenphp'>>
u.php:>< exple xtes have " plynamia this)ffeum!! e
Notafunct107389

.php?sect=rea107389perm=eunction.image-type-to-extension">Repperm=v> =utle="PHP RVlassup!ss="refenotes"> <-v> u">up

.php?sect=rea107389perm=eunction.image-type-to-extension">Repperm=v> =oadsle="PHP RVlassoads!ss="refenotes"> <-v>

aref=="note"r /&nbuts"="/" cl#107389Est; ared="b="titledtype=""PHP R2012-02-06 10:06rong>image5 ybsps agoong>

lang> style="dc-titt"> D/**> s n> sn> n> sn> D# Testspan >Spa, until I wrlassdhis)
Notafunct60033

.php?sect=rea60033perm=eunction.image-type-to-extension">Repperm=v> =utle="PHP RVlassup!ss="refenotes"> <-v> u">up

.php?sect=rea60033perm=eunction.image-type-to-extension">Repperm=v> =oadsle="PHP RVlassoads!ss="refenotes"> <-v>

aref=="note"r /&nbuts"="/" cl#60033Est; ared="b="titledtype=""PHP R2005-12-23 05:44rong>image11 ybsps agoong>

lang> When I wns writnd Geetion">tffectypphoto website, ith=ns necessary p : nvalueen> >
Notafunct79688

.php?sect=rea79688perm=eunction.image-type-to-extension">Repperm=v> =utle="PHP RVlassup!ss="refenotes"> <-v> u">up

.php?sect=rea79688perm=eunction.image-type-to-extension">Repperm=v> =oadsle="PHP RVlassoads!ss="refenotes"> <-v>

aref=="note"r /&nbuts"="/" cl#79688Est; ared="b="titledtype=""PHP R2007-12-07 11:26rong>image10 ybsps agoong>

lang> Thp'e i e" ineedop>
D// We are exp">Snd Gen natigtr.n D// We are exp">Snd Gen natigtr.n
Stion.image-type-to-extension">Repperm=redindct=http://fr2sect.netal/es/fues/ion.image-type-to-extension">Repsect add as" idn> mall> are e.imag>/div> e.imag>