note 35821 added to function.str-shuffle
| From: | floweb at rn2 dot php dot net | Date: | Tue, 16 Sep 2003 02:09:56 +0000 |
| Subject: | note 35821 added to function.str-shuffle | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-56551@lists.php.net to get a copy of this message | ||
this is basically the equivelent to the str_shuffle they use
function str_shuffle($word){
for($i=0;$i<strlen($word);$i++)
$array[]=$word[$i];
shuffle($array);
for($i=0;$i<count($array);$i++)
$newstring .= $array[$i];
return $newstring;
}
sidenote: wrote this when me and a friend were writing some code and i realized i was using 4.3.0
and he was using 4.2.0 needless to say my code took less lines :)
----
Manual Page -- http://www.php.net/manual/en/function.str-shuffle.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35821
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35821&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35821&report=yes