PHP | base64_decode() Function
The base64_decode() is an inbuilt function in PHP which is used to Decodes data which is encoded in MIME base64.
Syntax:
string base64_decode( $data, $strict )
Parameters: This function accepts two parameter as mantioned above and described below:
- $data: It is mandatory parameter which contains the encoded string.
- $strict: It is an optional parameter. If this parameter is set to TRUE then the base64_decode() function will return FALSE if the input contains character from outside the base64 alphabet. Invalid characters will be silently discarded.
Return value: This function returns the decoded string on success or returns False in case of failure.
Below programs illustrate the base64_decode() function in PHP:
Program 1:
<?php // Program to illustrate base64_decode() // function $str = 'R2Vla3Nmb3JHZWVrcw=='; echo base64_decode($str); ?> |
GeeksforGeeks
Program 2:
<?php // Program to illustrate base64_decode() // function $str = 'R0ZHLCBBIGNvbXB1dGVyIFNjaWVuY2UgUG9ydGFsIEZvciBHZWVrcw'; echo base64_decode($str). "\n"; $str = 'MQ=='; echo base64_decode($str). "\n"; ?> |
GFG, A computer Science Portal For Geeks 1
Reference: http://php.net/manual/en/function.base64-decode.php
Recommended Posts:
- How to call a function that return another function in JavaScript ?
- How to get the function name from within that function using JavaScript ?
- D3.js | d3.map.set() Function
- D3.js | d3.hcl() Function
- D3.js | d3.lab() Function
- D3.js | d3.set.add() Function
- PHP | each() Function
- PHP | ord() Function
- p5.js | nfs() Function
- p5.js | box() Function
- CSS | hsl() Function
- PHP | cos( ) Function
- PHP | Ds\Map xor() Function
- PHP | tan( ) Function
- PHP | Ds\Map put() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



