Popełniłem kiedyś coś takiego. MOże Ci się przyda.
<?php
function cp2pl($tekst, $z1 = \"x\", $z2 = \" \") {
$pl =array (65
, 67
, 69
, 76
, 78
, 79
, 83
, 90
, 90
, 97
, 99
, 101
,108
,110
,111
,115
,122
,122
); $cp1250=array (165
,198
,202
,163
,209
,211
,140
,143
,175
,185
,230
,234
,179
,241
,243
,156
,159
,191
); for($i = 0; $i < 18; $i++)
$tekst=str_replace(Chr
($cp1250[$i]),Chr
($pl[$i]),$tekst); $ascii = ord($tekst[$i]);
if($ascii < 48 || ($ascii > 57 && $ascii < 65) || ($ascii > 90 && $ascii < 97) || $ascii > 122)
$tekst[$i] = $z1;
}
return $tekst;
} //cp2pl
function iso2pl($tekst, $z1 = \"x\", $z2 = \" \") {
$iso88592=array (161
,198
,202
,163
,209
,211
,166
,172
,175
,177
,230
,234
,179
,241
,243
,182
,188
,191
); $pl =array (65
, 67
, 69
, 76
, 78
, 79
, 83
, 90
, 90
, 97
, 99
, 101
,108
,110
,111
,115
,122
,122
); for($i = 0; $i < 18; $i++) {
$tekst=str_replace(Chr
($iso88592[$i]),Chr
($pl[$i]),$tekst); }
$ascii = ord($tekst[$i]);
if($ascii < 48 || ($ascii > 57 && $ascii < 65) || ($ascii > 90 && $ascii < 97) || $ascii > 122) {
$tekst[$i] = $z1;
}
}
return $tekst;
} //iso2pl
?>