ymaps.ready(init);
function init() {
var myMap = new ymaps.Map("map", {
center: [55.733835, 37.588227],
zoom: 10
}, {
searchControlProvider: 'yandex#search'
});
myMap.balloon.open([55.733835, 37.588227], {
contentBody: [
'<address>',
'<strong>Офис Яндекса в Москве</strong>',
'<br/>',
'Адрес: 119021, Москва, ул. Льва Толстого, 16',
'<br/>',
'Подробнее: <a href="https://company.yandex.ru/">https://company.yandex.ru</a>',
'</address>'
].join('')
});
}
add_theme_support( 'wp-block-styles' );
// remove Gutenberg styles
function remove_gutenberg_styles() {
wp_dequeue_style( 'wp-block-library' );
}
add_action( 'wp_enqueue_scripts', 'remove_gutenberg_styles', 100 );
[
['alex', '111111'],
['alex', 2222222],
...
]
[
'111111' => ['alex', 'john'],
'222222' => ['alex']
...
]
$data = [
'alex' => [
"1111111",
"2222222",
"1726354"
],
'john' => [
"1111111",
"3333333",
"7162534"
],
'michel' => [
"1111111",
"453453453",
"3333333"
]
] ;
$res = [];
foreach ($data as $name => $phones) {
foreach($phones as $phone) {
if (!array_key_exists($phone, $res)) {
$res[$phone] = [];
}
$res[$phone][] = $name;
}
}
print_r($res)
Array
(
[1111111] => Array
(
[0] => alex
[1] => john
[2] => michel
)
[2222222] => Array
(
[0] => alex
)
[1726354] => Array
(
[0] => alex
)
[3333333] => Array
(
[0] => john
[1] => michel
)
[7162534] => Array
(
[0] => john
)
[453453453] => Array
(
[0] => michel
)
)
function getcontents($url){
if(filter_var($url,FILTER_VALIDATE_URL)) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
// ssl?
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
return file_get_contents($url);
}
echo getcontents('https://www.rusprofile.ru/id/11597949');
exec();
ну или вообще модуль для phpexec();
exec();
$a = [
[
'name' => 'Название 1',
'price' => 140,
],
[
'name' => 'Название 2',
'price' => 140,
]
];
$b = [2, 10];
$result = array_map(fn($item, $qty) => $item + ['quantity' => $qty], $a, $b);
$result = array_map(function ($item, $qty) {
return $item + ['quantity' => $qty];
}, $a, $b);