title: Twilio PHP Lookup API is returning no response if number is not correct?
body: <p>I am trying to impliment a Twilio Lookup API for validation of phone numbers are they correct or not.</p>
  <p>What I have tried is a PHP <a href="https://www.twilio.com/docs/lookup/api" rel="nofollow noreferrer">Lookup API documentation</a></p>
  <pre><code>$number = &quot;+15445453&quot;; // Wrong Number
  $number = &quot;+18186794307&quot;; // Correct Number
  
  $twilio = new Client($this-&gt;session-&gt;userdata('account_sid'), $this-&gt;session-&gt;userdata('auth_token'));
  $phone_number = $twilio-&gt;lookups-&gt;v1-&gt;phoneNumbers($number)-&gt;fetch([&quot;type&quot; =&gt; [&quot;carrier&quot;]]);
  </code></pre>
  <p>For the correct number, it is returning the response, whereas for the wrong number it's empty nothing response.</p>
  <p><a href="https://i.stack.imgur.com/x4u7G.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x4u7G.png" alt="enter image description here" /></a></p>
  <p>After digging some I found another solution <a href="https://stackoverflow.com/questions/31354989/twilio-lookup-api-not-working">link</a> that is using curl and getter a response if a number is not correct.</p>
  <pre><code>$base_url = &quot;https://lookups.twilio.com/v1/PhoneNumbers/&quot; . $number;
  $ch = curl_init($base_url);
  
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
  curl_setopt($ch, CURLOPT_USERPWD, &quot;$account_sid:$auth_token&quot; );
  
  $response = curl_exec($ch);
  $response = json_decode($response);
  
  echo &quot;&lt;pre&gt;&quot;;   print_r($response); echo &quot;&lt;/pre&gt;&quot;;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/8jKtl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8jKtl.jpg" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/wXiSA.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wXiSA.jpg" alt="enter image description here" /></a></p>
  <p><strong>What's the issue in PHP lookup API that I am missing to implement and  causing no response if a number is not correct?</strong></p>