drupal_base64_encode()

返回值:经过base64编码的安全的,可用于URL参数的字符串

参考地址:https://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/drupal_base64_encode/7.x

function drupal_base64_encode( $string ){
    $data = base64_encode($string);
    return strtr($data,array('+'=>'-','/'=>'_','='=>''));
}
print drupal_base64_encode('drupal7');//ZHJ1cGFsNw