php 加密解密

用这个加密:base64_encode ( string $data )
<?php
$str = 'This is an encoded string';
echo base64_encode($str);
?>
用这个解密:base64_decode ( string $data [, bool $strict= false ] )
<?php
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
echo base64_decode($str);
?>
posted @ 2013-03-07 10:32  awinlei  阅读(234)  评论(0编辑  收藏  举报