Function __global->basename

Definitions

sources_custom/phpstub.php

  • Returns filename 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
$path PATH No No required parameter N/A N/A Path
$ext string No No Blank (empty string) N/A N/A File extension to cut off (blank: none)

Returns

  • File name component
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Returns filename component of path.
 *
 * @param  PATH $path Path
 * @param  string $ext File extension to cut off (blank: none)
 * @return string File name component
 */

function basename(string $path, string $ext = '') : string