07-04-2008, 05:17 PM
|
#3 (permalink)
|
|
The Wanderer
Join Date: Dec 2007
Location: Orlando, FL
Posts: 23
Thanks: 0
|
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.
|
|
|
|