PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

BaseName

Zend_Filter_BaseName allows you to filter a string which contains the path to a file and it will return the base name of this file.

Supported options for Zend_Filter_BaseName

There are no additional options for Zend_Filter_BaseName.

Basic usage

A basic example of usage is below:

<?php
$filter 
= new Zend_Filter_BaseName();

print 
$filter->filter('/vol/tmp/filename');

This will return 'filename'.

<?php
$filter 
= new Zend_Filter_BaseName();

print 
$filter->filter('/vol/tmp/filename.txt');

This will return 'filename.txt'.

Zend Framework