Function __global->handle_string_bom
Definitions
sources/global3.php
- Detect a BOM (Unicode byte-order-mark) from a string, and strip it. Return the altered string.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $contents | string | No | No | required parameter | N/A | N/A | Input string |
| $default_charset | ?string | No | No | Null | N/A | N/A | The default character set to assume if none is specified in the input string (null: website character set) |
Returns
- Altered string
- Type: string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Detect a BOM (Unicode byte-order-mark) from a string, and strip it. Return the altered string.
*
* @param string $contents Input string
* @param ?string $default_charset The default character set to assume if none is specified in the input string (null: website character set)
* @return string Altered string
*/
function handle_string_bom(string $contents, ?string $default_charset = null) : string
* Detect a BOM (Unicode byte-order-mark) from a string, and strip it. Return the altered string.
*
* @param string $contents Input string
* @param ?string $default_charset The default character set to assume if none is specified in the input string (null: website character set)
* @return string Altered string
*/
function handle_string_bom(string $contents, ?string $default_charset = null) : string

