title: Get json item phone_number from telegram api
body: <p>Get <code>json</code> from:</p>
  
  <pre><code>https://api.telegram.org/--token--/getUpdates
  </code></pre>
  
  <p>Return:</p>
  
  <pre><code>stdClass Object
  (
  [ok] =&gt; 1
  [result] =&gt; Array
  (
  [0] =&gt; stdClass Object
  (
  [update_id] =&gt; 122101947
  [message] =&gt; stdClass Object
  (
  [message_id] =&gt; 36
  [from] =&gt; stdClass Object
  (
      [id] =&gt; 88132232
      [is_bot] =&gt; 
      [first_name] =&gt; Mike
      [last_name] =&gt; Christ
      [username] =&gt; mike_ch
      [language_code] =&gt; en
  )
  
  [chat] =&gt; stdClass Object
  (
      [id] =&gt; 88132232
      [first_name] =&gt; Mike
      [last_name] =&gt; Christ
      [username] =&gt; mike_ch
      [type] =&gt; private
  )
  
  [date] =&gt; 1512046846
  [contact] =&gt; stdClass Object
  (
      [phone_number] =&gt; +905394792446
      [first_name] =&gt; Mike
      [last_name] =&gt; Christ
      [user_id] =&gt; 88132232
  )
  )
  )
  )
  )
  </code></pre>
  
  <p>Now i want to get <code>phone_number</code>:</p>
  
  <pre><code>$update = json_decode(file_get_contents($getUpdate));
  echo $update-&gt;result[0]-&gt;message-&gt;contact-&gt;phone_number;
  </code></pre>
  
  <p>It return nothing and errorlog is:</p>
  
  <blockquote>
    <p>PHP Notice:  Undefined property: stdClass::$contact in
    /home/xxx/public_html/public_projects/xxx/seller/modules/telegram.php
    on line 10 </p>
    
    <p>PHP Notice:  Trying to get property of non-object in
    /home/xxx/public_html/public_projects/xxx/seller/modules/telegram.php
    on line 10</p>
  </blockquote>
  
  <p>But i am able to get successfully <code>date</code> or <code>chat</code> like this:</p>
  
  <pre><code>echo $update-&gt;result[0]-&gt;message-&gt;chat-&gt;first_name;
  </code></pre>
  
  <p>Any suggestion?</p>
  
  <p><strong>Edit:</strong> my <code>php</code> code:</p>
  
  <pre><code>function getUpdate(){
  global $token;
  $getUpdate = "http://api.telegram.org/" . $token . "/getUpdates";
  
  $update = json_decode(file_get_contents($getUpdate));
  echo $update-&gt;result[0]-&gt;message-&gt;contact-&gt;phone_number;
  }
  </code></pre>