toStrings.php
Table of Contents
Functions
- toStrings() : array<int, string>
- Filters a value down to a list of strings, keeping every string and integer and dropping the rest.
Functions
toStrings()
Filters a value down to a list of strings, keeping every string and integer and dropping the rest.
toStrings(mixed $value) : array<int, string>
The value is first passed through toArray() (a bare scalar is wrapped as a
single-element list), then walked : string and int items are kept, cast to
string ; anything else (float, bool, null, arrays, objects, resources) is dropped.
Parameters
- $value : mixed
-
The value to filter — an array, or a bare scalar wrapped via
toArray().
Tags
Return values
array<int, string> —The kept items, cast to string, re-indexed from 0.