Home >Backend Development >PHP Problem >What does the php base64_decode() method do?
In PHP, the base64_decode() method is used to decode data encoded using MIME base64 and return the original data, the syntax is "base64_decode($data,$strict)".
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In php, we can use base64_encode() function to perform base64 encryption, and the base64_decode() function can decrypt.
The base64_decode() function is a built-in function in PHP that is used to decode data encoded using MIME base64.
Syntax:
base64_decode(string $data, bool $strict = false)
Decode base64 encoded data.
Parameters: This function accepts two parameters
data: encoded data.
strict: an optional parameter. When strict is set to true, once the input data exceeds the base64 alphabet, false will be returned. Otherwise invalid characters are silently discarded.
Return value: Return the original data, or return false on failure. The data returned may be binary.
Example:
<?php $str = 'SGVsbG8gV29ybGQ='; echo base64_decode($str); ?>
Output result:
PHP Video Tutorial"
The above is the detailed content of What does the php base64_decode() method do?. For more information, please follow other related articles on the PHP Chinese website!