PHP and AJAX tool to transform text


You want to transform text form ascii to base64, urlencode it, digest it, etc.

Or you want to decode these formats.



Just wrote this tool, to allow instant transformation of data into following formats:

base64 encode decode, urlencode decode, md5 and sha1 hashing, addslashes and htmlentities

click here to access the transform tool
Pretty cool to see ‘all’ too – check it out.



Here is the code:


if(isset($_GET['mode'])) {



switch($mode) {

case "base64_encode": echo base64_encode($val); break;
case "base64_decode": echo base64_decode($val); break;
case "urldecode": echo urldecode($val); break;
case "urlencode": echo urlencode($val); break;
case "htmlentities": echo htmlentities($val); break;
case "rot13": echo str_rot13($val);break;
case "md5": echo md5($val);break;
case "sha1": echo sha1($val);break;
case "all":

echo "base64_encode: ".base64_encode($val);
echo "base64_decode: ".base64_decode($val);
echo "urldecode: ".urldecode($val);
echo "urlencode: ".urlencode($val);
echo "htmlentities: ".htmlentities($val);
echo "addslashes: ".addslashes($val);
echo "rot13: ".str_rot13($val);
echo "md5: ".md5($val);
echo "sha1: ".sha1($val);







[tags]AJAX Tool, PHP AJAX, PHP Coding School[/tags]


If you have found my website useful, please consider buying me a coffee below 😉

Leave a Reply

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