← All docs

intval()

Returns the integer value of a variable, optionally using a given base.

intval()

function intval(mixed $value, int $base = 10): int

Returns the integer value of a variable, optionally using a given base.

Parameters:

  • $value (mixed)
  • $base (int), default 10, optional

Returns: int

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

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