PHP str_rot13 () function
Examples
Encoding and decoding strings:
<?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");
?>
Running instance »
Definition and Usage
str_rot13 () function performs the ROT13 encoding on strings.
ROT13 coding is put each letter in the alphabet 13 letters to get moving forward. Digital and non-letter characters remain unchanged.
Tip: encoding and decoding are done by the same function.If you put an encoded string as a parameter, then return to the original string.
grammar
str_rot13( string )
参数 | 描述 |
---|---|
string | 必需。规定要编码的字符串。 |
technical details
return value: | Returns the ROT13 encoded string. |
---|---|
PHP version: | 4.2.0+ |
Update log: | Prior to PHP 4.3, string can be modified, as if passed by reference the same. |
PHP String Reference