How rot13 on a string using PHP?

大憨熊 提交于 2019-12-07 23:43:33

问题


I have a big php code that i want to encode and decode it manually.
My problem is that php code has many single quotes and double quotes inside and because of them i have errors while using str_rot13() function like below...
So what is the correct syntax and how can I use the function below for encode:

str_rot13 ('That php Code');

And how can i decode that encoded file? I couldn't find a reverse function!

thanks in advance


回答1:


The nice thing about rot13 is that it's reflective. applying rot 13 twice (e.g. rot 26) brings you right back to where you came from.




回答2:


Rot 13 is only designed to handle the 26 characters of the standard English alphabet. If you need more characters, you might want to have a look at ROT47 which is briefly explained here



来源:https://stackoverflow.com/questions/10653981/how-rot13-on-a-string-using-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!