PHP: Storing Strings via Array
<p>I have a question about this situation, How could I store string via Array?
this is my code</p>

<pre><code>&lt;?php
$octets = array($_POST["oct1"],$_POST["oct2"],$_POST["oct3"],$_POST["oct4"]);
$octlenfnl = count($octets) - 1;
$binoctstr = 0 ;
if($_POST["oct1"] &lt;= 255 &amp;&amp; $_POST["oct1"] &lt;= 255 &amp;&amp; $_POST["oct1"] &lt;= 255 &amp;&amp; $_POST["oct1"] &lt;= 255)
{
    for($i=0;$i&lt;=$octlenfnl;$i++){
        echo str_pad(decbin($octets[$i]), 8, '0', STR_PAD_LEFT) , "&amp;nbsp";
    }
}
else
{
    echo "Invalid IP!";
}

?&gt;
</code></pre>

<p>It outputs entered IP to Binary octets just like this <code>11111111 0001000 10010101 10010101</code>, they have spaces between the Octets, how can I split them and store it to array that is accessible globally? </p>

<p>Thanks</p>
