← All docs

mb_ord()

Returns the first Unicode codepoint, or false for malformed input.

mb_ord()

function mb_ord(string $string, ?string $encoding = null): int|false

Returns the first Unicode codepoint, or false for malformed input.

Parameters:

  • $string (string)
  • $encoding (?string), default null, optional

Returns: int|false

Availability

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

Internals

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