Re: Multiple words str_shuffle

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

 



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 ;-)

--
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