case хуй if count res response fwd_messages str iconv windows-1251 UTF

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
case "!хуй":
if(count($res["response"][$i]["fwd_messages"]) == 1){
$str = iconv("windows-1251", "UTF-8", file_get_contents('http://huifikator.ru/api.php?text='.urlencode($res["response"][$i]["fwd_messages"][0]["body"])));
$arr = explode(' ', $str);
foreach($arr as $val => $key)
if (strlen($val) > 2) $arr[$key] = substr($val, strpos($val, '-') + 1);
$str = implode(' ', $arr);
send($chat_id, $str);
}elseif(isset($args[1]) && (count($res["response"][$i]["fwd_messages"]) == 0)){
unset($args[0]);
$msg = implode(' ', $args);
$str = iconv("windows-1251", "UTF-8", file_get_contents('http://huifikator.ru/api.php?text='.urlencode($msg)));
$arr = explode(' ', $str);
foreach($arr as $val => $key)
if (strlen($val) > 2) $arr[$key] = substr($val, strpos($val, '-') + 1);
$str = implode(' ', $arr);
send($chat_id, $str);
}else{
send($chat_id, "Отправка помощи");
}
break;