<?php
$text = "Why are Blogs {important|essential|crucial|critical|vital|significant} in {Seo|Search engine optimization} ?
Blogs {can be|may be|could be|might be|is usually|is often} hosted on {your own|your personal} private server or {you can|you are able to|you'll be able to|it
is possible to|you may|you could} use {sites|websites|web sites|internet sites|web-sites} that {allow|permit|enable} you to
{create|produce|generate|make|develop} {free|totally free|free of charge|no cost|cost-free|absolutely free} blogs which {will be|will probably be|will likely be|is.";
function get_random($matches)
{
$rand = array_rand($split = explode("|", $matches[1]));
return $split[$rand];
}
function show_randomized($str)
{
$new_str = preg_replace_callback('/\{([^{}]*)\}/im', "get_random", $str);
if ($new_str !== $str) $str = show_randomized($new_str);
return $str;
}
echo show_randomized($text);
?>