← All docs

htmlentities()

Converts all applicable characters in a string into their HTML entities.

htmlentities()

function htmlentities(string $string, int $flags = 11, string $encoding = 'UTF-8'): string

Converts all applicable characters in a string into their HTML entities.

Parameters:

  • $string (string)
  • $flags (int), default 11, optional
  • $encoding (string), default 'UTF-8', optional

Returns: string

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

Internals

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