Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

base64_decode(3) [php man page]

BASE64_DECODE(3)							 1							  BASE64_DECODE(3)

base64_decode - Decodes data encoded with MIME base64

SYNOPSIS
string base64_decode (string $data, [bool $strict = false]) DESCRIPTION
Decodes a base64 encoded $data. PARAMETERS
o $data - The encoded data. o $strict - Returns FALSE if input contains character from outside the base64 alphabet. RETURN VALUES
Returns the original data or FALSE on failure. The returned data may be binary. CHANGELOG
+--------+---------------+ |Version | | | | | | | Description | | | | +--------+---------------+ | 5.2.0 | | | | | | | $strict added | | | | +--------+---------------+ EXAMPLES
Example #1 base64_decode(3) example <?php $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='; echo base64_decode($str); ?> The above example will output: This is an encoded string SEE ALSO
base64_encode(3), RFC 2045 section 6.8. PHP Documentation Group BASE64_DECODE(3)

Check Out this Related Man Page

HEX2BIN(3)								 1								HEX2BIN(3)

hex2bin - Decodes a hexadecimally encoded binary string

SYNOPSIS
string hex2bin (string $data) DESCRIPTION
Decodes a hexadecimally encoded binary string. Caution This function does NOT convert a hexadecimal number to a binary number. This can be done using the base_convert(3) function. PARAMETERS
o $data - Hexadecimal representation of data. RETURN VALUES
Returns the binary representation of the given data or FALSE on failure. ERRORS
/EXCEPTIONS If the hexadecimal input string is of odd length or invalid hexadecimal string an E_WARNING level error is thrown. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.5.1 | | | | | | | A warning is thrown if the input string is | | | invalid hexadecimal string. | | | | | 5.4.1 | | | | | | | A warning is thrown if the input string is of | | | odd length. In PHP 5.4.0 the string was silently | | | accepted, but the last byte was truncated. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 hex2bin(3) example <?php $hex = hex2bin("6578616d706c65206865782064617461"); var_dump($hex); ?> The above example will output something similar to: string(16) "example hex data" SEE ALSO
bin2hex(3), unpack(3). PHP Documentation Group HEX2BIN(3)
Man Page