← All docs

image_type_to_extension()

Returns the filename extension for an IMAGETYPE_* constant.

image_type_to_extension()

function image_type_to_extension(int $image_type, bool $include_dot = true): mixed

Returns the filename extension for an IMAGETYPE_* constant.

Parameters:

  • $image_type (int)
  • $include_dot (bool), default true, optional

Returns: mixed

Availability

  • Compiled (AOT): supported through the compiler-injected image prelude.
  • eval() (magician interpreter): not available inside eval’d code.

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how image_type_to_extension is implemented in the compiler, see the internals page.