i'm using zend_tables for my model and i'd like to create a function to convert all data from a single row (retireved like this: $row = $model->find($id)) to htmlentities before outputting it with the usual code:
echo ($row->current()->nameOfField);
I need something like this function i use on arrays:
public static function convertArrayToHtmlEntities($data){
$keys = array_keys($data);
foreach ($keys as $k) {
$d = $data[$k];
$clean = htmlentities($d, ENT_QUOTES, "UTF-8");
$data[$k] = $clean;
}
return $data;
}
Thx in advance!