<?php
$urls = [
'https://google.com/',
'https://bing.com/'
];
$names = [
'Google',
'Bing'
];
echo json_encode(
array_map(
fn($url, $name) => get_defined_vars(),
$urls,
$names
),
JSON_PRETTY_PRINT
);
- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
- [
{
"url": "https:\/\/google.com\/",
"name": "Google"
},
{
"url": "https:\/\/bing.com\/",
"name": "Bing"
}
]
preferences:
77.2 ms | 407 KiB | 5 Q