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

search for in the

SplFileInfo::getCTime> <SplFileInfo::getATime
[edit] Last updated: Fri, 24 Jun 2011

view this page in

SplFileInfo::getBasename

(PHP 5 >= 5.2.2)

SplFileInfo::getBasenameدریافت مرکز نام قایل

Description

public string SplFileInfo::getBasename ([ string $suffix ] )

این متد مرکز نام قایل، دایرکتوری یا پیوند را یدون اطلاعات مسیر بازمی‌گرداند.

Parameters

suffix

پسوند اختیاری برای حذف از نام مرکز بازگردانده شده.

Return Values

بازگرداندن مرکز نام بدون اطلاعات مسیر.

Examples

Example #1 مثال SplFileInfo::getBasename()

<?php
$info 
= new SplFileInfo('file.txt');
var_dump($info->getbaseName());

$info = new SplFileInfo('/path/to/file.txt');
var_dump($info->getbaseName());

$info = new SplFileInfo('/path/to/file.txt');
var_dump($info->getbaseName('.txt'));
?>

The above example will output something similar to:

string(8) "file.txt"
string(8) "file.txt"
string(4) "file" 

See Also



add a note add a note User Contributed Notes SplFileInfo::getBasename - [0 notes]
There are no user contributed notes for this page.

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