Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php filter non utf-8 characters

function remove_bs($Str) {  
  $StrArr = str_split($Str); $NewStr = '';
  foreach ($StrArr as $Char) {    
    $CharNo = ord($Char);
    if ($CharNo == 163) { $NewStr .= $Char; continue; } // keep £ 
    if ($CharNo > 31 && $CharNo < 127) {
      $NewStr .= $Char;    
    }
  }  
  return $NewStr;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #filter #characters
ADD COMMENT
Topic
Name
9+5 =