Str::esc()
Escape string for context specific output
Str::esc(string $string, string $context = 'html'): string
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| $stringrequired | string |
no default value | Untrusted data |
| $context | string |
'html'
|
Location of output (html, attr, js, css, url or xml) |
Return type
string
Escaped data