View Single Post
Old 07-04-2008, 06:17 PM   #3 (permalink)
Rizza
The Wanderer
 
Rizza's Avatar
 
Join Date: Dec 2007
Location: Orlando, FL
Posts: 23
Thanks: 0
Rizza is on a distinguished road
Default

There is a lot of code that you were using unnecessarily. No reason to use a constant, a function and definitely shouldn't be exiting an application for no reason (additionally, if you're using "exit" and don't have a message to send with it, no need to use exit(). :)

PHP Code:
<?php

if ( isset($_GET['bytes']) )
{
    
$bits = (int) $_GET['bytes'] * 8;
    for ( 
$x 0$x $bits$x++ )
    {
        
$number += pow(2$x);
    }
    echo 
$number;
}
?>
That will suit you just fine and is quite shorter.
Rizza is offline  
Reply With Quote