note 22765 modified in function.chr by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:54:52 +0000 |
| Subject: | note 22765 modified in function.chr by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79729@lists.php.net to get a copy of this message | ||
This bit of code will convert all those lovely tilde,umlaut etc. etc. characters into safe character
codes:
<?php
$trans_array = array();
for ($i=127; $i<255; $i++) {
$trans_array[chr($i)] = "&#" . $i . ";";
}
$outtext = strtr($intext, $trans_array);
?>
--was--
This bit of code will convert all those lovely tilde,umlaut etc. etc. characters into safe character
codes:
$trans_array = array();
for ($i=127; $i<255; $i++) {
$trans_array[chr($i)] = "&#" . $i . ";";
}
$outtext = strtr($intext, $trans_array);
http://php.net/manual/en/function.chr.php