title: PHP Telegram Bot running on Xampp Apache HTTP error
body: <p>This is the error it gives me when I run it. Can someone please help me?</p>
  
  <blockquote>
    <p>Warning:
    file_get_contents(<a href="https://api.telegram.org/bot/sendMessage?chat_id=&amp;text=default" rel="nofollow noreferrer">https://api.telegram.org/bot/sendMessage?chat_id=&amp;text=default</a>):
    failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
    in C:\xampp\htdocs\Socializers_bot\index.php on line 30</p>
  </blockquote>
  
  <pre><code>  &lt;?php
  
     ini_set('error_reporting', E_ALL);
  
   $botToken = "";
   $website = "https://api.telegram.org/bot".$botToken;
  
  $update = file_get_contents('php://input');
  $update = json_decode($update, TRUE);
  
  $chatId = $update["message"]["chat"]["id"];
  $message = $update["message"]["text"];
  
  switch($message) {
  
  case "/test":
      sendMessage($chatId, "test");
      break;
  case "/hi":
      sendMessage($chatId, "hey there!");
      break;
  default:
      sendMessage($chatId, "default");
  
   }
  
   function sendMessage ($chatId, $message) {
  
  $url = $GLOBALS['website']."/sendMessagechat_id=".$chatId."&amp;text=".urlencode($message);
  file_get_contents($url);
   }
  
   ?&gt;
  </code></pre>
  
  <p>I also Tried changing URL to CURL. <code>$curl</code>, <code>urlencode</code>... and it gave me another error.</p>