To nie skrypcik, tylko funkcja, którą należy użyć we własnym skrypcie.
Przykład użycia:
<?php
function iso2pl($tekst) {
$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); }
return $tekst;
}
function win2pl($tekst) {
$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
($iso88592[$i]),Chr
($pl[$i]),$tekst); }
return $tekst;
}
$tekst = 'zażółć gęśłą jaźń';
$tekst2 = iso2pl($tekst);
$tekst3 = win2pl($tekst);
echo $tekst.'<br>'.$tekst2.'<br>'.$tekst3; ?>