note 21416 added to function.str-rot13
| From: | Virtual@php.net | Date: | Sun, 12 May 2002 09:23:53 +0000 |
| Subject: | note 21416 added to function.str-rot13 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-30499@lists.php.net to get a copy of this message | ||
And this for ROT-13 decoding:
<?
if(!function_exists('str_unrot13')){
function str_unrot13($str){
$from = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM';
$to = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
return strtr($str, $from, $to);
}
}
$rot = str_rot13("Hi, this string is ROT-13 encoded!");echo $rot;
$unrot = str_unrot13($rot);echo $unrot;
?>
Prints:
Uv, guvf fgevat vf EBG-13 rapbqrq!Hi, this string is ROT-13 encoded!
*simple*
--
http://www.php.net/manual/en/function.str-rot13.php
http://master.php.net/manage/user-notes.php?action=edit+21416
http://master.php.net/manage/user-notes.php?action=delete+21416
http://master.php.net/manage/user-notes.php?action=reject+21416