PHP base_convert

I wrote a simple tool to visualize numbers in different bases to help solve a math problem I was thinking about
the other day. It uses PHP.

Convert numbers

Use this form to convert numbers between different bases.

This can be useful for visualizating numbers in different bases.

Input base number:

Numbers To Convert (1 per line)

Output base number:

if( isset( $_REQUEST[“input_data”] ) )
$base_in = $_REQUEST[“base_in”];
$base_out = $_REQUEST[“base_out”];
$input_data = $_REQUEST[“input_data”];
$lines = preg_split(“/(\r?\n)/”, $input_data);
$lines_count = count( $lines );

echo “ output in base $base_out
foreach( $lines as $line)
// do stuff with $line
echo base_convert( $line, $base_in, $base_out).”\n



Restored by Emergency Restore

Leave a Reply

Your email address will not be published. Required fields are marked *