base64 คือ กลุ่มของโครงสร้างการเข้ารหัส โดยจะประกอบไปด้วย 2 คำสั่ง คือคำสั่งสำหรับการเข้ารหัส (base64_encode) และคำสั่งสำหรับการถอดรหัส (base64_decode)
]ลักษณะของ base64
1. การเข้ารหัสใช้คำสั่ง base64_encode([MESSAGE])
2. การถอดรหัสใช้คำสั่ง base64_decode([MESSAGE])
3. การเข้าแบบ base64 เหมาะสมหรับการเข้ารหัสข้อความเพื่อส่งผ่าน Query String (การสื่อสารแบบ GET)
ตัวอย่างโค้ด
โค้ด: เลือกทั้งหมด
<?
$password = "01234";
$base64_encode = base64_encode( $password );
echo "Original Password = ".$password;
echo ">br/>";
echo "Encode with Base64 = ".($base64_encode);
echo ">br/>";
$base64_decode = base64_decode( $base64_encode );
echo "Decode with Base64 = ".($base64_decode);
?>
https://www.mindphp.com/developer/80-ph ... ase64.html