simplify if isset case php
<p>sorry if this quite a easy question, but i cant find any thread the same as this.</p>

<p>lets say we are setting the values like</p>

<pre><code>    &lt;li&gt;&lt;input type="checkbox" name="only_admin" value="1" /&gt; Only Admin&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" name="can_request" value="1" /&gt; Can Request&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" name="can_offer" value="1" /&gt; Can Offer&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" name="can_post" value="1" /&gt; Can Post&lt;/li&gt;
    &lt;li&gt;&lt;input type="checkbox" name="is_maintenance" value="1" /&gt; Is Maintenance&lt;/li&gt;
</code></pre>

<p>then on our server side we put this</p>

<pre><code>        if (isset($_POST['only_admin'])) {
            $permission['only_admin'] = $_POST['only_admin'];
        }

        if (isset($_POST['can_request'])) {
            $permission['can_request'] = $_POST['can_request'];
        }

        if (isset($_POST['can_offer'])) {
            $permission['can_offer'] = $_POST['can_offer'];
        }   

        if (isset($_POST['can_post'])) {
            $permission['can_post'] = $_POST['can_post'];
        }

        if (isset($_POST['is_maintenance'])) {
            $permission['is_maintenance'] = $_POST['is_maintenance'];
        }
</code></pre>

<p>is there a simpler version to above code ?</p>

<p>thanks!
Adam Ramadhan</p>

<p><em>ps</em> please tag me if there is already a good thread about this.*</p>
