Function __global->dirname

Definitions

sources_custom/phpstub.php

  • Returns directory name component of path.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$name PATH No No required parameter N/A N/A The path
$levels integer No No 1 N/A N/A Levels up from filename

Returns

  • The directory name component
  • Type: PATH
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Returns directory name component of path.
 *
 * @param  PATH $name The path
 * @param  integer $levels Levels up from filename
 * @return PATH The directory name component
 */

function dirname(string $name, int $levels = 1) : string