resolveList.php
Table of Contents
Functions
- resolveList() : string|null
- Resolves a list from a string or an array : - splits the string by the given separator - trims each element - removes empty elements - joins the list using the specified replacement - returns $default if the resulting list is empty
Functions
resolveList()
Resolves a list from a string or an array : - splits the string by the given separator - trims each element - removes empty elements - joins the list using the specified replacement - returns $default if the resulting list is empty
resolveList(string|array<string|int, mixed>|null $value[, string $separator = ';' ][, string $replace = PHP_EOL ][, string|null $default = null ]) : string|null
Parameters
- $value : string|array<string|int, mixed>|null
-
Input value (string or array)
- $separator : string = ';'
-
Separator for input string (default ';')
- $replace : string = PHP_EOL
-
Separator for output string (default PHP_EOL)
- $default : string|null = null
-
Default value if the result is empty
Tags
Return values
string|null —Normalized string or default