|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-28 14:12 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 09:00:01 2025 UTC |
Description: ------------ I have a string encrypted with mcrypt and encoded in base64. I unbase64 this string and I decrypt it using mcrypt. I got the exact same string but when I try to explode it into an array with the explode() function, I cannot make comparison == with the last element of the newly created array. Reproduce code: --------------- $key = "validkey"; $input = base64_decode($txtEncrypted); $decrypted = mcrypt_ecb(MCRYPT_RIJNDAEL_128, $key, $input, MCRYPT_DECRYPT); echo $decrypted."<br>"; $array_data = explode('||', $decrypted); echo "|".$array_data."|<br>"; if ($array_data[8] == 'end') { echo "it works!"; } Expected result: ---------------- data||ddata||daata||dadta||dasta||datad||daata||datsa||end |end| it works! Actual result: -------------- data||ddata||daata||dadta||dasta||datad||daata||datsa||end |end|