Decodes data encoded with MIME base64
Syntax
base64_decode ( string $data [, bool $strict = FALSE ] ) : string
Parameters
data
The encoded data.
strict
If the strict parameter is set to TRUE then the base64_decode() function will return FALSE if the input contains characters from outside the base64 alphabet. Otherwise invalid characters will be silently discarded.
Return
Returns the decoded data or FALSE on failure. The returned data may be binary.
Examples
1 · data
<? $data = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==' . '#'; $return = base64_decode($data); var_export($return); ?>
'This is an encoded string'
2 · strict
<? $data = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==' . '#'; $strict = true; $return = base64_decode($data, $strict); var_export($return); ?>
false