PHP 字符串 str_rot13() 函数

2024 年 9 月 4 日 | 阅读 1 分钟

str_rot13() 是 PHP 内置函数。它用于对字符串执行 ROT12 编码。

该函数将字母表中的每个字母移动 13 位进行编码,而数字和非字母字符保持不变。

注意:该函数使用同一个函数对数据进行编码或解码。

语法

参数描述必需/可选
String指定要编码的字符串必需

示例 1

输出

Before using str_rot13() function:Hello PHP
Before using str_rot13() function:Uryyb CUC

示例 2

输出

Before using str_rot13() function:Uryyb CUC
After using str_rot13() function:Hello PHP

示例 3

输出

Both string is is Equall: Hello PHP = Hello PHP

引用

https://php.ac.cn/manual/en/function.str-rot13.php
下一主题PHP 字符串