Home >Backend Development >PHP Tutorial >Chinese base64 code conversion code between PHP and JavaScript_PHP tutorial
//PHP base64_encode
function str_encode($str){
return base64_encode(iconv('GB18030','UTF-8',$str));
}
echo str_encode('Hello! Beauty!');
?>
/////////////////// ///////////////////////////////////////////////////// //////////////////
Attached is PHP’s base64 encryption and decryption functions!
{echo base64_encode($str)."
"; //Encryption
$ss='Z25pZD0yNSZncGljaT0x';
echo base64_decode($ss); //Decryption
/////////////////////////////////////////////////// //////////////////////////////////////
/ /JavaScript base64_decode