I would like to convert my xor function to PHP. Can it be done? It needs to work as it`s working now...
string encryptDecrypt(string toEncrypt) {
char key[9] = { '1', '2', '3', '4', '5', '6', '7', '8', '9' };
string output = toEncrypt;
for (int i = 0; i < toEncrypt.size(); i++)
output[i] = toEncrypt[i] ^ key[i % (sizeof(key) / sizeof(char))];
return output;
}