Hi. Try running the following code (remove any "word" wrapping if necessary).
PHP Code:
<?php
$text = "My t-shirt is blue.";
define('PHPDIG_ENCODING','iso-8859-1');
$phpdig_string_subst['iso-8859-1'] = 'A:ÀÁÂÃÄÅ,a:*áâãäå,O:ÒÓÔÕÖØ,o:òóôõöø,E:ÈÉÊË,e:èéêë,C:Ç,c:ç,I:ÌÍÎÏ,i:ì*îï,U:ÙÚÛÜ,u:ùúûü,Y:Ý,y:ÿý,N:Ñ,n:ñ';
$phpdig_words_chars['iso-8859-1'] = '[:alnum:]ðþß';
$text = phpdigEpureText($text);
function phpdigEpureText($text,$min_word_length=2,$encoding=PHPDIG_ENCODING) {
global $phpdig_words_chars;
echo $text . " A<---<br><br>\n";
$text = phpdigStripAccents(strtolower ($text));
echo $text . " B<---<br><br>\n";
//no-latin upper to lowercase - now islandic
switch (PHPDIG_ENCODING) {
case 'iso-8859-1':
$text = strtr( $text,'ÐÞ','ðþ');
break;
}
echo $text . " C<---<br><br>\n";
$text = ereg_replace('[[:blank:]][0-9]+[[:blank:]]',' ',ereg_replace('[^'.$phpdig_words_chars[$encoding].'._&%/-]+',' ',$text));
echo $text . " D<---<br><br>\n";
$text = ereg_replace('[[:blank:]][^ ]{1,'.$min_word_length.'}[[:blank:]]',' ',' '.$text.' ');
echo $text . " E<---<br><br>\n";
$text = ereg_replace('\\.+[[:blank:]]|\\.+$|\\.{2,}',' ',$text);
echo $text . " F<---<br><br>\n";
return trim(ereg_replace("[[:blank:]]+"," ",$text));
}
function phpdigStripAccents($chaine,$encoding=PHPDIG_ENCODING) {
$phpdigEncode = array();
global $phpdigEncode;
if (!isset($phpdigEncode[$encoding])) {
$encoding = PHPDIG_ENCODING;
}
// exceptions
if ($encoding == 'iso-8859-1') {
$chaine = str_replace('Æ','ae',str_replace('æ','ae',$chaine));
}
return( strtr( $chaine,$phpdigEncode[$encoding]['str'],$phpdigEncode[$encoding]['tr']) );
}
echo $text . " G<---<br><br>\n";
?>
What is the output when viewing the HTML source? The output I get is the following.
Code:
My t-shirt is blue. A<---<br><br>
my t-shirt is blue. B<---<br><br>
my t-shirt is blue. C<---<br><br>
my t-shirt is blue. D<---<br><br>
t-shirt blue. E<---<br><br>
t-shirt blue F<---<br><br>
t-shirt blue G<---<br><br>