note 129170 added to function.base64-decode

From: Date: Wed, 17 Jan 2024 23:42:20 +0000
Subject: note 129170 added to function.base64-decode
Groups: php.notes 
Request: Send a blank email to php-notes+get-221124@lists.php.net to get a copy of this message
Note, that padding characters are not limited to "=". any character(s) at the end of the string that cannot be decoded will be interpreted as padding. if $strict is set to true, of course padding characters are limited to base64 characters. examples: <?php // $strict = false; $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='; echo base64_decode($str); // This is an encoded string $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw'; echo base64_decode($str); // This is an encoded string $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZwA'; echo base64_decode($str); // This is an encoded string $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZwA='; echo base64_decode($str); // This is an encoded string // $strict = true; $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw=='; echo base64_decode($str, true); // This is an encoded string $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZw'; echo base64_decode($str, true); // This is an encoded string $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZwA'; echo base64_decode($str, true); // This is an encoded string $str = 'VGhpcyBpcyBhbiBlbmNvZGVkIHN0cmluZwA='; echo base64_decode($str, true); // This is an encoded string ?> ---- Server IP: 45.112.84.4 Probable Submitter: 45.91.157.134 (proxied: 194.118.40.169) ---- Manual Page -- https://php.net/manual/en/function.base64-decode.php Edit -- https://main.php.net/note/edit/129170 Del: integrated -- https://main.php.net/note/delete/129170/integrated Del: useless -- https://main.php.net/note/delete/129170/useless Del: bad code -- https://main.php.net/note/delete/129170/bad+code Del: spam -- https://main.php.net/note/delete/129170/spam Del: non-english -- https://main.php.net/note/delete/129170/non-english Del: in docs -- https://main.php.net/note/delete/129170/in+docs Del: other reasons-- https://main.php.net/note/delete/129170 Reject -- https://main.php.net/note/reject/129170 Search -- https://main.php.net/manage/user-notes.php

« previous php.notes (#221124) next »