note 80142 added to function.str-rot13
| From: | grawity+phpnet at gmail dot com | Date: | Mon, 31 Dec 2007 13:31:19 +0000 |
| Subject: | note 80142 added to function.str-rot13 | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-134622@lists.php.net to get a copy of this message | ||
(re:#76975) a non-recursive version.
<?php
function asc_shift($str,$offset=0) {
$new = "";
for ($i = 0; $i < strlen($str); $i++)
$new .= chr(ord($str{$i})+$offset);
return $new;
}
?>
this function shifts round, so
<?php
asc_shift($str,257) == asc_shift($str,1);
?>
for example.
----
Server IP: 193.46.83.2
Probable Submitter: 78.56.68.25
----
Manual Page -- http://www.php.net/manual/en/function.str-rot13.php
Edit -- https://master.php.net/note/edit/80142
Del: integrated -- https://master.php.net/note/delete/80142/integrated
Del: useless -- https://master.php.net/note/delete/80142/useless
Del: bad code -- https://master.php.net/note/delete/80142/bad+code
Del: spam -- https://master.php.net/note/delete/80142/spam
Del: non-english -- https://master.php.net/note/delete/80142/non-english
Del: in docs -- https://master.php.net/note/delete/80142/in+docs
Del: other reasons-- https://master.php.net/note/delete/80142
Reject -- https://master.php.net/note/reject/80142
Search -- https://master.php.net/manage/user-notes.php