[Solved] Convert c++ function to PHP?
You can use almost the same syntax in PHP as your C++ function does: function encryptDecrypt($toEncrypt) { $key= array( ‘1’, ‘2’, ‘3’, ‘4’, ‘5’, ‘6’, ‘7’, ‘8’, ‘9’ ); $key_len = count($key); $output = $toEncrypt; for ($i = 0; $i < strlen($toEncrypt); $i++) { $output[$i] = $toEncrypt[$i] ^ $key[$i % $key_len]; } return $output; } … Read more