note 40730 added to ref.strings

From: Date: Fri, 12 Mar 2004 13:39:37 +0000
Subject: note 40730 added to ref.strings
Groups: php.notes 
Request: Send a blank email to php-notes+get-66716@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/ref.strings.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40730 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40730&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40730&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66716) next »