note 123244 added to function.str-rot13

From: Date: Sat, 20 Oct 2018 11:29:38 +0000
Subject: note 123244 added to function.str-rot13
Groups: php.notes 
Request: Send a blank email to php-notes+get-209467@lists.php.net to get a copy of this message
My own generic rotN function <?php function rotN($string, $n = 13) { $alphabet = join(range('a', 'z')); $alen = strlen($alphabet); $n %= $alen; if($n < 0) { $n += $alen; } if($n == 0) { return $string; } $cycled = substr($alphabet . $alphabet, $n, $alen); $alphabet = $alphabet . strtoupper($alphabet); $cycled = $cycled . strtoupper($cycled); return strtr($string, $alphabet, $cycled); } ?> ---- Server IP: 150.242.41.218 Probable Submitter: 125.239.42.229 ---- Manual Page -- http://php.net/manual/en/function.str-rot13.php Edit -- https://master.php.net/note/edit/123244 Del: integrated -- https://master.php.net/note/delete/123244/integrated Del: useless -- https://master.php.net/note/delete/123244/useless Del: bad code -- https://master.php.net/note/delete/123244/bad+code Del: spam -- https://master.php.net/note/delete/123244/spam Del: non-english -- https://master.php.net/note/delete/123244/non-english Del: in docs -- https://master.php.net/note/delete/123244/in+docs Del: other reasons-- https://master.php.net/note/delete/123244 Reject -- https://master.php.net/note/reject/123244 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#209467) next »