function drupal_base64_encode

7.x bootstrap.inc drupal_base64_encode($string)
6.x bootstrap.inc drupal_base64_encode($string)

Returns a URL-safe, base64 encoded version of the supplied string.

Parameters

$string: The string to convert to base64.

Return value

string

1 call to drupal_base64_encode()
drupal_random_key in drupal/includes/bootstrap.inc
Returns a URL-safe, base64 encoded string of highly randomized bytes (over the full 8-bit range).

File

drupal/includes/bootstrap.inc, line 1974
Functions that need to be loaded on every Drupal request.

Code

function drupal_base64_encode($string) {
  $data = base64_encode($string);
  // Modify the output so it's safe to use in URLs.
  return strtr($data, array('+' => '-', '/' => '_', '=' => ''));
}