This code is adapted from the PHP manual entry on html_entity_decode()
protected function decode($data)
{
$data = html_entity_decode($data, ENT_QUOTES,'UTF-8');
//echo $data;
return $data;
}
protected function decode_data($data)
{
if(is_object($data) || is_array($data)){
array_walk_recursive($data,array($this,'decode'));
}else{
$data = html_entity_decode($data, ENT_QUOTES,'UTF-8');
}
return $data;
}
If data contains an a value like Children's it does not get decoded to Children's