base64_binary()

Scalar. Returns a binary value for a given base64-encoded string.

Syntax

base64_binary ( string )

Parameters

string

A base64-encoded string. Valid characters include a-z, A-Z, 0-9, /, and +.

Usage

The function converts a base64-encoded string to a binary type. The string length cannot have a remainder of 1 when divided by 4, as it makes the encoding invalid. Optionally, use one or two padding characters, '=' in order to make the length divisible by 4.

Example

base64_binary ( 'bGVhc3VyZS4=') returns 6C6561737572652E.

base64_binary ( 'ZQ==') returns 65.