note 118801 added to function.base64-decode
| From: | markandrewslade at gmail dot com | Date: | Mon, 08 Feb 2016 16:34:51 +0000 |
| Subject: | note 118801 added to function.base64-decode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204898@lists.php.net to get a copy of this message | ||
The docs don't make this explicitly clear, but if you omit
$strict or set it to
false then invalid characters in the encoded input will be silently ignored.
<?php
echo base64_decode('VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='); // "This is an encoded
string"
echo base64_decode('$VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='); // "This is an encoded
string"
echo base64_decode('$VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw==', true); // false
?>
----
Server IP: 72.52.91.14
Probable Submitter: 192.234.2.18
----
Manual Page -- http://php.net/manual/en/function.base64-decode.php
Edit -- https://master.php.net/note/edit/118801
Del: integrated -- https://master.php.net/note/delete/118801/integrated
Del: useless -- https://master.php.net/note/delete/118801/useless
Del: bad code -- https://master.php.net/note/delete/118801/bad+code
Del: spam -- https://master.php.net/note/delete/118801/spam
Del: non-english -- https://master.php.net/note/delete/118801/non-english
Del: in docs -- https://master.php.net/note/delete/118801/in+docs
Del: other reasons-- https://master.php.net/note/delete/118801
Reject -- https://master.php.net/note/reject/118801
Search -- https://master.php.net/manage/user-notes.php