note 94728 modified in function.chunk-split by danbrown

From: Date: Fri, 20 Nov 2009 17:17:33 +0000
Subject: note 94728 modified in function.chunk-split by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163132@lists.php.net to get a copy of this message
//I've found this quite useful for simulating various kinds of shuffles with cards. //It is humorous but can imitate multiple deck cuts and other (imperfectly) random events. <?php function truffle_shuffle($body, $chunklen = 76, $end = "\r\n") { $chunk = chunk_split($body, $chunklen, "-=blender=-"); $truffle = explode("-=blender=-",$chunk); $shuffle = shuffle($truffle); $huknc = implode($end,$shuffle); return $huknc; } ?> --was-- //I've found this quite useful for simulating various kinds of shuffles with cards. //It is humorous but can imitate multiple deck cuts and other (imperfectly) random events. function truffle_shuffle($body, $chunklen = 76, $end = "\r\n") { $chunk = chunk_split($body, $chunklen, "-=blender=-"); $truffle = explode("-=blender=-",$chunk); $shuffle = shuffle($truffle); $huknc = implode($end,$shuffle); return $huknc; } http://php.net/manual/en/function.chunk-split.php

« previous php.notes (#163132) next »