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

Dir

Given a string containing a path to a file, this function will return the name of the directory.

Supported options for Zend_Filter_Dir

There are no additional options for Zend_Filter_Dir.

Basic usage

A basic example of usage is below:

<?php
$filter 
= new Zend_Filter_Dir();

print 
$filter->filter('/etc/passwd');

This returns "/etc".

<?php
$filter 
= new Zend_Filter_Dir();

print 
$filter->filter('C:/Temp/x');

This returns "C:/Temp".

Zend Framework