$name = $_POST['Имя'];
$phone = $_POST['Телефон'];
$none = 'пусто';
$arr = array(
'Имя: ' => $name,
'Телефон: ' => $phone,
'UpSell: ' => $upsell
);
foreach($arr as $key => $value) {
if(empty($value)) {
$txt .= "<b>".$key."</b> ".$none."%0A";
} else {
$txt .= "<b>".$key."</b> ".$value."%0A";
}
};
$txt = str_replace('+','+',$txt);
$sendToTelegram = fopen("https://api.telegram.org/bot{$token}/sendMessage?chat_id={$chat_id}&parse_mode=HTML&text={$txt}","r");