1:
function
getExt1(
$filename
)
{
$arr
=
explode
(
'.'
,
$filename
);
return
array_pop
(
$arr
);;
}
2:
function
getExt2(
$filename
)
{
$ext
=
strrchr
(
$filename
,
'.'
);
return
$ext
;
}
3:
function
getExt3(
$filename
)
{
$pos
=
strrpos
(
$filename
,
'.'
);
$ext
=
substr
(
$filename
,
$pos
);
return
$ext
;
}
4:
function
getExt4(
$filename
)
{
$arr
=
pathinfo
(
$filename
);
$ext
=
$arr
[
'extension'
];
return
$ext
;
}
5:
function
getExt4(
$filename
)
{
$arr
=
pathinfo
(
$filename
);
$ext
=
$arr
[
'extension'
];
return
$ext
;
}