title: How to get the first 3 parts of an ip adress in php
body: <p>I am trying to get first 3 parts of the ip address  in php.</p>
  
  <p>For example let us consider the ip address as </p>
  
  <pre><code>"1.2.3.4";
  </code></pre>
  
  <p>then I would like to get </p>
  
  <pre><code>"1.2.3";
  </code></pre>
  
  <p>Thanks in advance.</p>