base64_decode
(PHP 4, PHP 5, PHP 7, PHP 8)
Decodes data encoded with MIME base64
Description
Decodes a base64 encoded string.
Parameters
stringThe encoded data.
strictIf the
strictparameter is set to true then thebase64_decode()function will return false if the input contains character from outside the base64 alphabet. Otherwise invalid characters will be silently discarded.
Return Values
Returns the decoded dataFalseforfailure. The returned data may be binary.
Examples
base64_decode() example
<?php
$str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==';
echo base64_decode($str);
?>The above example will output:
This is an encoded stringSee Also
base64_encode()- RFC 2045 section 6.8