Is it possible to rewrite this method to use yield
?
The method is traversing through a multidimensional array and edit each value (strip invalid UTF8 chars)
public function strip_invalid_utf8($input){
if(is_array($input)){
foreach($input as &$value){
$value = $this->strip_invalid_utf8($value);
}
return $input;
}
else{
return filter_utf8($input);
}
}