downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

SplFileInfo::getFileInfo> <SplFileInfo::getCTime
Last updated: Fri, 20 May 2011

view this page in

SplFileInfo::getExtension

(PHP 5 >= 5.3.6)

SplFileInfo::getExtensionGets the file extension

Descripción

public string SplFileInfo::getExtension ( void )

Retrieves the file extension.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Returns a string containing the file extension, or an empty string if the file has no extension.

Ejemplos

Example #1 SplFileInfo::getExtension() example

<?php

$info 
= new SplFileInfo('foo.txt');
var_dump($info->getExtension());

$info = new SplFileInfo('photo.jpg');
var_dump($info->getExtension());

$info = new SplFileInfo('something.tar.gz');
var_dump($info->getExtension());

?>

El resultado del ejemplo sería:

string(3) "txt"
string(3) "jpg"
string(2) "gz"

Ver también



add a note add a note User Contributed Notes SplFileInfo::getExtension
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites