PHP: How to convert 0777 (an octal) to a string?
<p>I have an octal that I am using to set permissions on a directory.</p>

<pre><code>$permissions = 0777;
mkdir($directory, $permissions, true)
</code></pre>

<p>And I want to compare it to a string</p>

<pre><code>$expectedPermissions = '0777'; //must be a string
if ($expectedPermissions != $permissions) {
    //do something
}
</code></pre>

<p>What would be the best way to do this comparison?</p>
