convert ipv4 netmask to cidr format
<p>I have the ip and netmask </p>

<pre><code>192.168.1.0 255.255.255.0
</code></pre>

<p>I need to convert the netmask into cidr format</p>

<pre><code>192.168.1.0/24
</code></pre>

<p>How do I convert ipv4 address and netmask into cidr format?</p>

<p>I am using PHP5.6</p>