note 40730 deleted from ref.strings by tomsommer
| From: | tomsommer@php.net | Date: | Wed, 15 Sep 2004 20:47:25 +0000 |
| Subject: | note 40730 deleted from ref.strings by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76785@lists.php.net to get a copy of this message | ||
Note Submitter: Joe Becher jwbecher at hotmail dot com
----
Someone here pointed out the code for left() and right() ASP functions for grabbing the left and
right parts of a string. Since rot13() only does alpha chars I made rotate():
function rotate ($str, $howManyChars)
{
$len = strlen($str);
$partone = substr ($str, $len - $howManyChars, $len);
$parttwo = substr ($str, 0, ($len - $howManyChars));
$str = $partone . $parttwo;
return $str;
}
Will take ANY string and 'rotate it', regardless of content. Hope it helps.