note 80142 deleted from function.str-rot13 by ezyang
| From: | ezyang@php.net | Date: | Mon, 31 Dec 2007 17:29:49 +0000 |
| Subject: | note 80142 deleted from function.str-rot13 by ezyang | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134629@lists.php.net to get a copy of this message | ||
Note Submitter: grawity+phpnet at gmail dot com
Reason: useless
----
(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.