function alpha($str, $len=16) {
  $strlen = strlen($str);

  $words = explode(" ", $str);
  $i = count($words);
  $j = 0;
  $newstr = null;
  while($i >= $j) {
    $newstr .= $words[$i];
    $i--;
  }
    

  $str = strrev($newstr);

  $a = substr($str, 0, $strlen/2);
  $b = substr($str, $strlen/2+1, $strlen);
  $str = $b.$a;

  $a = array("a", "e", "i", "o", "u", "A", "E", "I", "O", "U");
  $b = array("b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z", "B", "C", "D", "F", "G", "H", "J", "K", "L", "M", "N", "P", "Q", "R", "S", "T", "V", "W", "X", "Y", "Z");
  $c = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
  $str = str_replace($a, "a", $str);
  $str = str_replace($b, "b", $str);
  $str = str_replace($c, "c", $str);

  $newstrlen = strlen($str);
  $i = 0;
  $newstr = null;
  while($i <= $newstrlen) { 
    if($str[$i]!="a" AND $str[$i]!="b" AND $str[$i]!="c") {
      $newstr .= "d";
    } else {
      $newstr .= $str[$i];
    }
    $i++;
  }

  $j = strlen($newstr);
  while($j<=$len) {
    $newstr .= $newstr;
    $j = strlen($newstr);
  }

  $str = substr($newstr, 0, $len);

  return $str;
}