Function __global->cms_mb_substr
Definitions
sources/global3.php
- Return part of a string, with utf-8 awareness where possible/required.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $in | string | No | No | required parameter | N/A | N/A | The subject |
| $from | integer | No | No | required parameter | N/A | N/A | The start position |
| $amount | ?integer | No | No | Null | N/A | N/A | The length to extract (null: all remaining) |
| $force | boolean | No | No | False | N/A | N/A | Whether to force unicode as on |
Returns
- String part (false: $start was over the end of the string)
- Type: ~string
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Return part of a string, with utf-8 awareness where possible/required.
*
* @param string $in The subject
* @param integer $from The start position
* @param ?integer $amount The length to extract (null: all remaining)
* @param boolean $force Whether to force unicode as on
* @return ~string String part (false: $start was over the end of the string)
*/
function cms_mb_substr(string $in, int $from, ?int $amount = null, bool $force = false)
* Return part of a string, with utf-8 awareness where possible/required.
*
* @param string $in The subject
* @param integer $from The start position
* @param ?integer $amount The length to extract (null: all remaining)
* @param boolean $force Whether to force unicode as on
* @return ~string String part (false: $start was over the end of the string)
*/
function cms_mb_substr(string $in, int $from, ?int $amount = null, bool $force = false)

