note 70931 added to function.chr
| From: | jgraef at users dot sourceforge dot net | Date: | Sat, 04 Nov 2006 18:15:06 +0000 |
| Subject: | note 70931 added to function.chr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119395@lists.php.net to get a copy of this message | ||
Hi,
This little function will replace unreadable chars with a "." in your string
function onlyreadables($string) {
for ($i=0;$i<strlen($string);$i++) {
$chr = $string{$i};
$ord = ord($chr);
if ($ord<32 or $ord>126) {
$chr = ".";
$string{$i} = $chr;
}
}
return $string;
}
----
Server IP: 66.163.161.117
Probable Submitter: 84.168.103.119
----
Manual Page -- http://www.php.net/manual/en/function.chr.php
Edit -- https://master.php.net/note/edit/70931
Del: integrated -- https://master.php.net/note/delete/70931/integrated
Del: useless -- https://master.php.net/note/delete/70931/useless
Del: bad code -- https://master.php.net/note/delete/70931/bad+code
Del: spam -- https://master.php.net/note/delete/70931/spam
Del: non-english -- https://master.php.net/note/delete/70931/non-english
Del: in docs -- https://master.php.net/note/delete/70931/in+docs
Del: other reasons-- https://master.php.net/note/delete/70931
Reject -- https://master.php.net/note/reject/70931
Search -- https://master.php.net/manage/user-notes.php