Websites for sale:
Web Hosting Reviews and Rating, Used Cars for Sale and Car Sale.
If interested please send my an email at ken@kensfi.com. Thanks!

Randomize sentences into a phrase using PHP functions

I was looking for a while to find a sentence randomizer from a phrase and I didn’t find anything. There are scripts for randomize words but for clauses nothing. I don’t know php but with little (little bit more actually) help I did it.

Copy this code into a webpage, replace the phrase with yours and you will have at every page refresh a new phrase. The sentences will rotate random, in no specific order.

< ?
$phrase = 'What does pride in your work have to do with stopping support for IE6. A browser that debuted EIGHT years ago. This is ridiculous. Any developer that continues to create hack or workarounds for this abysmal browser should lose their job.';

$sentences = explode("." , $phrase);
shuffle ($sentences);

foreach ($sentences as $element) {
    echo $element . ". ";
    }
?>

Don’t forget, after you paste the code to replace the line numbers. Unfortunately I couldn’t find any way to remove it.

Popularity: 5% [?]

If you enjoyed this post, make sure you subscribe to my RSS feed!

Post to Twitter Post to Digg Post to Facebook

Related tech articles

Coding

If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

ss_blog_claim=a60fe0ab4bb2f93087f423c86b8d54f3

Leave Comment

(required)

(required)