htmlspecialchars()
function htmlspecialchars(string $string, int $flags = 11, string $encoding = 'UTF-8'): string
Converts the HTML special characters in a string into their entities.
Parameters:
$string(string)$flags(int), default11, optional$encoding(string), default'UTF-8', optional
Returns: string
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/htmlspecialchars.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how htmlspecialchars is implemented in the compiler, see the internals page.