Aoccdrnig to rseearch at an Elingsh uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoatnt tihng is that the frist and lsat ltteer is at the rghit pclae. The rset can be a toatl mses and you can sitll raed it wouthit a porbelm. Tihs is bcuseae we do not raed ervey lteter by it slef but the wrod as a wlohe.
Hree's a cdoe taht slerbmcas txet in tihs way:
<?php
function scramble_word($word) {
if (strlen($word) < 2)
return $word;
else
return $word{0} . str_shuffle(substr($word, 1, -1)) . $word{strlen($word) - 1};
}
echo preg_replace('/(\w+)/e', 'scramble_word("\1")', 'A quick brown fox jumped over the lazy dog.');
?>
It may be ufseul if you wnat to cetare an aessblicce CTCPAHA.