← All built-ins / base64_encode()

base64_encode()

base64_encode(string $s): string

Parameters

NameTypeDescription
$sstringraw bytes

Return value

Base64 text (with = padding).

Example

echo base64_encode("holy php");
aG9seSBwaHA=

See also

base64_decode()bin2hex()