note 121940 added to function.rtrim

From: Date: Wed, 29 Nov 2017 13:54:11 +0000
Subject: note 121940 added to function.rtrim
Groups: php.notes 
Request: Send a blank email to php-notes+get-209248@lists.php.net to get a copy of this message
rtrim escape the last five character Class GeneralFunction { static $salt="6638029068"; static function encrypt($text) { return base64_encode($text.self::$salt); } static function decrypt($text) { return rtrim(base64_decode($text),self::$salt); } } $text ="9015123000"; echo $encrypted=GeneralFunction::encrypt($text); //output OTAxNTEyMzAwMC02NjM4MDI5MDY4 echo GeneralFunction::decrypt($encrypted);//output 90151 but expected output is 9015123000 ---- Server IP: 208.43.231.9 Probable Submitter: 14.142.56.19 ---- Manual Page -- http://php.net/manual/en/function.rtrim.php Edit -- https://master.php.net/note/edit/121940 Del: integrated -- https://master.php.net/note/delete/121940/integrated Del: useless -- https://master.php.net/note/delete/121940/useless Del: bad code -- https://master.php.net/note/delete/121940/bad+code Del: spam -- https://master.php.net/note/delete/121940/spam Del: non-english -- https://master.php.net/note/delete/121940/non-english Del: in docs -- https://master.php.net/note/delete/121940/in+docs Del: other reasons-- https://master.php.net/note/delete/121940 Reject -- https://master.php.net/note/reject/121940 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209248) next »