3v4l.org

run code in 300+ PHP versions simultaneously
<?php $c1="ClVLIh4ASCsCBE8lAxMacFMZV2hdVVotEhhUJQNVAmhSFl4sFxJeaAw="; function xor_encrypt($in) { $key = base64_decode($c1); $text = $in; $outText = ''; // Iterate through each character for($i=0;$i<strlen($text);$i++) { $outText .= $text[$i] ^ $key[$i % strlen($key)]; } return $outText; } $defdata = array( "showpassword"=>"no", "bgcolor"=>"#00000"); print xor_encrypt(json_encode($defdata)); #decode $tmp= json_decode(xor_encrypt($c2), true); if (is_array($tmp)) { print $tmp['showpassword']; print $tmp['bgcolor']; } else print "Error!"; print " <> "; #encode print xor_encrypt(json_encode($defdata));

preferences:
36.87 ms | 402 KiB | 5 Q