';
// }
//else {
if($last_change[who][$mb] == 's'){
$sContent1 = file_get_contents('https://api.vk.com/method/groups.getById?group_ids=' .$valuemb .'&v=5.131&lang=0&access_token=' .$token);
if (preg_match_all('|name":"(.+)"|isU', $sContent1, $arr))
{
$first_name_m1 = ($arr[1][0]);// запись названия сообщества
}
if (preg_match_all('|photo_200":"(.+)"|isU', $sContent1, $arr))
{
$photo_m1 = ($arr[1][0]);// запись фото
}
$last_name_m1 = '';//обнуляем фамилию
}
else{
$sContent1 = file_get_contents('https://api.vk.com/method/users.get?user_ids=' .$valuemb .'&fields=photo_max,sex,online,last_seen&v=5.131&lang=0&access_token=' .$token);
if (preg_match_all('|first_name":"(.+)"|isU', $sContent1, $arr))
{
$first_name_m1 = ($arr[1][0]);// запись статуса в переменную
}
if (preg_match_all('|last_name":"(.+)"|isU', $sContent1, $arr))
{
$last_name_m1 = ($arr[1][0]);// запись статуса в переменную
}
if (preg_match_all('|photo_max":"(.+)"|isU', $sContent1, $arr))
{
$photo_m1 = ($arr[1][0]);// запись статуса в переменную
}
if (preg_match_all('|"online":(.+),|isU', $sContent1, $arr))
{
$online_m1 = ($arr[1][0]);// запись статуса в переменную
}
if (preg_match_all('|"time":(.+),|isU', $sContent1, $arr))
{
$time_m1 = ($arr[1][0]);// запись статуса в переменную
}
if (preg_match_all('|platform":(.+)}|isU', $sContent1, $arr))
{
$platform_m1 = ($arr[1][0]);// запись статуса в переменную
}
if (preg_match_all('|sex":(.+),|isU', $sContent1, $arr))
{
$sex_m1 = ($arr[1][0]);// запись статуса в переменную
}
if ($platform_m1 == '1') {$platform_m_par1 = 'мобильная версия';}
if ($platform_m1 == '2') {$platform_m_par1 = 'iPhone';}
if ($platform_m1 == '3') {$platform_m_par1 = 'iPad';}
if ($platform_m1 == '4') {$platform_m_par1 = 'Android';}
if ($platform_m1 == '5') {$platform_m_par1 = 'Windows Phone';}
if ($platform_m1 == '6') {$platform_m_par1 = 'Windows 10';}
if ($platform_m1 == '7') {$platform_m_par1 = 'С компьютера';}
if ($platform_m1 == '8') {$platform_m_par1 = 'VK Mobile';}
}
if ($last_change[change][$mb] == 'add')
{
if ($sex_m1 == '1' and $last_change[who][$mb] == 'friends') {$addmet='Добавлена/Добавилась';}
if ($sex_m1 == '2' and $last_change[who][$mb] == 'friends') {$addmet='Добавлен/Добавилcя';}
if ($sex_m1 == '1' and $last_change[who][$mb] == 'fo') {$addmet='Подписалась ';}
if ($sex_m1 == '2' and $last_change[who][$mb] == 'fo') {$addmet='Подписался ';}
if ($sex_m == '1' and $last_change[who][$mb] == 's') {$addmet='Подписалась к ';}
if ($sex_m == '2' and $last_change[who][$mb] == 's') {$addmet='Подписался к ';}
}
if ($last_change[change][$mb] == 'delete')
{
if ($sex_m1 == '1' and $last_change[who][$mb] == 'friends') {$addmet='Удалена/Удалилась';}
if ($sex_m1 == '2' and $last_change[who][$mb] == 'friends') {$addmet='Удален/Удалился';}
if ($sex_m1 == '1' and $last_change[who][$mb] == 'fo') {$addmet='Отписалась ';}
if ($sex_m1 == '2' and $last_change[who][$mb] == 'fo') {$addmet='Отписался ';}
if ($sex_m == '1' and $last_change[who][$mb] == 's') {$addmet='Отписалась от ';}
if ($sex_m == '2' and $last_change[who][$mb] == 's') {$addmet='Отписался от ';}
}
if ($last_change[who][$mb] == 's') {$webvk='https://vk.com/club';} else {$webvk='https://vk.com/id';}
echo '