Package Home

Zend Framework 2 Documentation (Manual)

PHK Home

File: /_sources/modules/zend.filter.dir.txt

Size:635
Storage flags:no_autoload,compress/gzip (49%)

.. _zend.filter.set.dir:

Dir
---

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

.. _zend.filter.set.dir.options:

Supported Options
^^^^^^^^^^^^^^^^^

There are no additional options for ``Zend\Filter\Dir``.

.. _zend.filter.set.dir.basic:

Basic Usage
^^^^^^^^^^^

A basic example of usage is below:

.. code-block:: php
   :linenos:

   $filter = new Zend\Filter\Dir();

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

This returns "``/etc``".

.. code-block:: php
   :linenos:

   $filter = new Zend\Filter\Dir();

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

This returns "``C:/Temp``".



For more information about the PHK package format: http://phk.tekwire.net