title: telegram api send message return nothing
body: <p>I want to send message via <code>telegram api</code> but it's not working, and not send any message. this is what i tried so far:</p>
  
  <pre><code>function sendTelegram($chatID, $msg) {
  echo "sending message to " . $chatID . "\n";
  
  $token = "botxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
  $getUpdate = "http://api.telegram.org/" . $token . "/getUpdates";
  
  $url = "https://api.telegram.org/" . $token . "/sendMessage?chat_id=" . $chatID;
  $url = $url . "&amp;text=" . urlencode($msg);
  $ch = curl_init();
  $optArray = array(
  CURLOPT_URL =&gt; $url,
  CURLOPT_RETURNTRANSFER =&gt; true
  );
  curl_setopt_array($ch, $optArray);
  $result = curl_exec($ch);
  curl_close($ch);
  }
  
  $msg = "Hi";
  $chatID = "88132232";
  
  sendTelegram($chatID, $msg);
  </code></pre>
  
  <p><strong>My progress:</strong></p>
  
  <ol>
  <li>I made a <code>new bot</code> via <code>@botfather</code> and got a <code>token</code>.</li>
  <li>Then sent a message to this <code>bot</code> with my <code>telegram</code>.</li>
  <li>I got <code>chat id</code> in <code>getUpdates</code>.</li>
  </ol>
  
  <blockquote>
    <p><a href="https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getUpdates" rel="nofollow noreferrer">https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/getUpdates</a></p>
  </blockquote>
  
  <p>and also <code>send message</code> via:</p>
  
  <blockquote>
    <p><a href="https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sendMessage?chat_id=88132232&amp;text=hi" rel="nofollow noreferrer">https://api.telegram.org/botxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/sendMessage?chat_id=88132232&amp;text=hi</a></p>
  </blockquote>
  
  <p>It works find when i go to this url but when i want to do this dynamically it give me nothing just echo <code>sending message to 88132232</code> with no error. I searched and read many topics but no success, any idea what i missed? Before using <code>curl</code> i used <code>get_file_contents</code> but it also not worked.</p>