$_POST variable in chmod permissions : <p>I wonder how to enter a $_POST variable to chmod permission :</p>

<p>I tried this way:</p>

<pre><code>&lt;?php 
    $file = 'myfile.txt';
    $permission = $_POST['permission'];
    chmod($file, $permission);
?&gt;
</code></pre>

<p>Unfortunately $permission variable, does not work in chmod.</p>

<pre><code>    $_POST['permission'] is '0755'
</code></pre>

<p>Is there any way to convert a variable to the correct format?</p>
