PHP: Number base conversion in PHP.

I thought I might “publicise” some of the code buried within this site.  There are some useful things in here (even if I do say so myself) ;). And it would be a shame not to ‘blog’ from the rooftops.  Some of the code isn’t much use in the real world, but it serves its purpose of teaching both programming methods and how to do funky things in PHP.

For first up, is arbitrary number base conversion in PHP.  I know PHP has a built in base_convert() function, plus several other specific base conversion functions, e.g. decbin(), but I wanted to a) show how to do it, and b) implement one which could do bases 2-62 (default PHP ones does 2-36).

http://www.pgregg.com/projects/php/base_conversion/base_conversion.php

7 Replies to “PHP: Number base conversion in PHP.”

  1. snip…non-english…crap… www dot 168hh dot com
    Spam from: 221.200.140.125

    Edited to remove the possibility of any referer link ever happening

  2. spammer of 168hh dot com

    Totally banned IPs: 221.200.0.0-221.203.255.255
    inetnum:      221.200.0.0 – 221.203.255.255
    netname:      CNCGROUP-LN
    descr:        CNCGROUP Liaoning Province Network
    descr:        China Network Communications Group Corporation
    descr:        No.156,Fu-Xing-Men-Nei Street,
    descr:        Beijing 100031
    country:      CN

    Far too much spam shit coming from there…  Good riddance.

  3. snip…non-english…crap… www dot 168hh dot com
    Spam from: 221.200.140.125

    Edited to remove the possibility of any referer link ever happening

  4. snip…non-english…crap… www dot 168hh dot com
    Spam from: 221.200.140.125

    Edited to remove the possibility of any referer link ever happening

  5. snip…non-english…crap… www dot 168hh dot com
    Spam from: 221.200.140.125

    Edited to remove the possibility of any referer link ever happening

  6. snip…non-english…crap… www dot 168hh dot com
    Spam from: 221.200.140.125

    Edited to remove the possibility of any referer link ever happening

  7. snip…non-english…crap… www dot 168hh dot com
    Spam from: 221.200.140.125

    Edited to remove the possibility of any referer link ever happening

Leave a Reply to 固体酒精,固体燃料,环保&#27 Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

All content © Paul Gregg, 1994 - 2024
This site http://pgregg.com has been online since 5th October 2000
Previous websites live at various URLs since 1994