$options = [
[
"condition" => isModerator(),
"execute" => function () {
echo 'isModerator';
}
],
[
"condition" => isSupport(),
"execute" => function () {
echo 'isSupport';
}
],
];
array_walk(array_filter($options, function ($item) {
return $item["condition"];
}), function ($item) {
$item["execute"]();
});
'title' => 'Animal Squad'
$items_set = array();
foreach ( $items as $item_id => $item ) {
for ( $i = 0; $i < $item['chance']; $i ++ ) {
$items_set[] = $item_id;
}
}
$rand_id = $items_set[array_rand( $items_set )];
$rand_item = $items[$rand_id];
return $rand_item["id"];
\[(?<id>id(?<idNumber>.*?))\|(?<notify>@(?<name>.*?))\]
Group `id` id296954377
Group `idNumber` 296954377
Group `notify` @wert43211
Group `name` wert43211
$re = '/\[(?<id>id(?<idNumber>.*?))\|(?<notify>@(?<name>.*?))\]/m';
$str = '[id296954377|@wert43211]';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
'Content-Type': 'application/x-www-form-urlencoded',
body: 'userPhone=1&userName=' + userName
let user = {
name: 'John',
surname: 'Smith'
};
let response = await fetch('/article/fetch/post/user', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(user)
});
let result = await response.json();
alert(result.message);
$code = 'var members = API.groups.getMembers({"group_id": '.$this->group_id.', "v": "5.80", "sort": "id_asc", "count": '.$offset.', "offset": '.$members_groups.'}).items;'
.'var offset = '.$offset.';'
.'while (offset < 25000 && (offset + '.$members_groups.') < '.$members_count.')'
.'{members = members + "," + API.groups.getMembers({"group_id": '.$this->group_id.', "v": "5.80", "sort": "id_asc", "count": '.$offset.', "offset": ('.$members_groups.' + offset)}).items;offset = offset + '.$offset.';};'
.'return members;';