Re: Multiple words str_shuffle
| From: | Jochem Maas | Date: | Tue, 08 Jul 2008 02:44:50 +0000 |
| Subject: | Re: Multiple words str_shuffle | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276425@lists.php.net to get a copy of this message | ||
grrr ... I rear my ugly head, briefly ...
Ron Piggott schreef:
I am trying to scramble individual words and/or phrases.try harder. <?php function mixit($m) { return trim(chunk_split(str_shuffle(strtoupper($m[1])),1,' ')); } echo preg_replace_callback('#(\w+)#', 'mixit', 'The rain. in Spain falls, mainly "on" the plain!'); ?> have integrity, read these before you copy, paste 'n' use: http://php.net/chunk_split http://php.net/preg_replace_callback questions on a postcard to Dan Brown, he just got married, he deserves it ;-)