PHP str_rot13() 函数
PHP 教程
· 2019-01-29 23:41:32
实例
编码并解码字符串:
<?php
echo str_rot13("Hello World");
echo "<br>";
echo str_rot13("Uryyb Jbeyq");
?>
echo str_rot13("Hello World");
echo "<br>";
echo str_rot13("Uryyb Jbeyq");
?>
定义和用法
str_rot13() 函数对字符串执行 ROT13 编码。
ROT13 编码是把每一个字母在字母表中向前移动 13 个字母得到。数字和非字母字符保持不变。
提示:编码和解码都是由相同的函数完成的。如果您把一个已编码的字符串作为参数,那么将返回原始字符串。
语法
str_rot13(string)
| 参数 | 描述 |
|---|---|
| string | 必需。规定要编码的字符串。 |
技术细节
| 返回值: | 返回 ROT13 编码的字符串。 |
|---|---|
| PHP 版本: | 4.2.0+ |
| 更新日志: | 在 PHP 4.3 之前,string 能被修改,就像是通过引用传递一样。 |
点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html
Effective JavaScript
David Herman / Addison-Wesley Professional / 2012-12-6 / USD 39.99
"It's uncommon to have a programming language wonk who can speak in such comfortable and friendly language as David does. His walk through the syntax and semantics of JavaScript is both charming and h......一起来看看 《Effective JavaScript》 这本书的介绍吧!