Rounding up to next significant figure
<p>I need to round up any integer between 1 and infinity in php to the next significant figure (though in practice I'm unlikely to need to round up infinity, so will be happy to settle on reasonable internal limits) eg:</p>

<pre><code>$x &lt;= 10 ? $x = 10 
10 &lt; $x &lt;= 100 ? $x = 100  
100 &lt; $x &lt;= 1000 ? $x = 1000  
</code></pre>

<p>etc.</p>

<p>Round / ceil etc don't seem to do the job quite as planned.  A pointer towards the correct algorhythm (or function?) would be much appreciated </p>
