Function __global->get_file_extension

Definitions

sources/global3.php

  • Get the file extension of the specified file. It returns without a dot. File extensions are considered never to themselves contain a dot.
  • 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 ?string No No required parameter N/A N/A The filename (null: unknown)
$mime_type ?string No No Null N/A N/A The mime-type (null: unknown)

Returns

  • The filename extension (no dot)
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get the file extension of the specified file. It returns without a dot. File extensions are considered never to themselves contain a dot.
 *
 * @param  ?string $name The filename (null: unknown)
 * @param  ?string $mime_type The mime-type (null: unknown)
 * @return string The filename extension (no dot)
 */

function get_file_extension(?string $name, ?string $mime_type = null) : string