Example
The input is an array of string something like
$strs = [
"some string",
"another string",
// ...
];
The result should be:
$result = [
[
"somestring",
true
],
[
"another string",
true
]
];
The application is to create an array for the data provider to test phone numbers in unit tests.
I can do this very easily in a loop, but I am wondering if there is an array function for it.
My loop solution:
$result = [];
foreach($strs as $str) {
$result[] = [$str, true];
}