toArray.php
Table of Contents
Functions
- toArray() : array<string|int, mixed>
- Ensures the given value is returned as an array.
Functions
toArray()
Ensures the given value is returned as an array.
toArray(mixed $value) : array<string|int, mixed>
If the value is already an array, it is returned unchanged. Otherwise, the value is wrapped inside a new array.
Parameters
- $value : mixed
-
The value to encapsulate in an array.
Tags
Return values
array<string|int, mixed> —The value wrapped in an array, or the original array if already an array.