PHP Base36 Encoding/Decoding for Text/Data

I want functions similar to base64_encode() and base64_decode() however only numbers and lowercase letters should be used.

I want to be able to convert a string of text or binary data into a series of numbers and lowercase letters.

My function works with numbers but not with text or binary data.

<?php

echo base36_encode('555555555');
echo '<hr />';
echo base36_encode('Hello World, this is a test!');

function base36_encode($base10){
    return base_convert($base10,10,36);
}
 
function base36_decode($base36){
    return base_convert($base36,36,10);
}

?>

Looks like, the same question is answered indifferent forum and also has anwere for that.

http://www.phpfreaks.com/forums/php-coding-help/php-base36-encodingdecoding-for-textdata/

What purpose would a Base36 function like that serve?

There isn’t anywhere that requires that only letters and numbers be passed. Base64 at least serves a purpose in that there are transmission methods that apply special meanings to some characters and applying base64 to BINARY content ensures that none of those special meanings will be accidentally generated by the content.

Anyway any baseX function will only apply to numbers - the Base64 functions look at the numeric value in each byte without caring about what actual character it represents (since that can depend on the character set being used anyway).

Since your requirement obviously has nothing to do with base64 or any other number base conversion functionality, it would help if you gave the reason why you want to convert all characters into numbers and letters so that we at least know what sort of conversion you are expecting.