Multiple words str_shuffle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am trying to scramble individual words and/or phrases.

When it is a phrase I would like to keep the letters of each word
together, with a space between each one.  The code I have so far is
below.  I use PHP 4.4.7.  The code below is fine for a single word; it
is phrases that I am now trying to accommodate.


An example:

rise and shine

Desired output:

I S R E  N A D   E H I S N

Thanks for your help, 

Ron



$keyword might be 

$keyword = str_shuffle(strtoupper($keyword));

$buffer = "";

for ($count = 0; ($count < strlen($keyword)); $count++) $buffer .=
$keyword{$count}." ";

$keyword = trim($buffer);

unset($buffer);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux