by M004 » 03/03/2014 10:36 pm
base64 คือ กลุ่มของโครงสร้างการเข้ารหัส โดยจะประกอบไปด้วย 2 คำสั่ง คือคำสั่งสำหรับการเข้ารหัส (base64_encode) และคำสั่งสำหรับการถอดรหัส (base64_decode)
ตัวอย่างการเข้ารหัส base64_encode
Code: Select all
$site = "mindphp.com";
$base64_encode = base64_encode( $site );
ผลลัพท์ที่ได้คือ bWluZHBocC5jb20=
ตัวอย่างการถอดรหัส base64_decode
Code: Select all
$site = "bWluZHBocC5jb20=";
$base64_decode = base64_decode( $site );
ผลลัพท์ที่ได้คือ mindphp.com
[b]base64[/b] คือ กลุ่มของโครงสร้างการเข้ารหัส โดยจะประกอบไปด้วย 2 คำสั่ง คือคำสั่งสำหรับการเข้ารหัส (base64_encode) และคำสั่งสำหรับการถอดรหัส (base64_decode)
[b]ตัวอย่างการเข้ารหัส base64_encode[/b]
[code=php]
$site = "mindphp.com";
$base64_encode = base64_encode( $site );
ผลลัพท์ที่ได้คือ bWluZHBocC5jb20=
[/code]
[b]ตัวอย่างการถอดรหัส base64_decode[/b]
[code=php]
$site = "bWluZHBocC5jb20=";
$base64_decode = base64_decode( $site );
ผลลัพท์ที่ได้คือ mindphp.com
[/code]