This works fine...
$row = array_map("html_entity_decode", $row);
BUT, I need to add the ENT_QUOTES flag and I cannot get it to work. Any ideas?
$row = array_map("html_entity_decode, ENT_QUOTES", $row);
This works fine...
$row = array_map("html_entity_decode", $row);
BUT, I need to add the ENT_QUOTES flag and I cannot get it to work. Any ideas?
$row = array_map("html_entity_decode, ENT_QUOTES", $row);
You can use a lambda function notation like this (PHP 7.4+)
$row = array_map(fn($e) => html_entity_decode($e, ENT_QUOTES), $row);
Before PHP 7.4 just use the normal anonymous function
$row = array_map(function($e) { return html_entity_decode($e, ENT_QUOTES); }, $row);
This seems to do it...
function myFunc($a) {
return html_entity_decode($a, ENT_QUOTES);
}
$row = array_map("myFunc", $row);
You can try with array_walk_recursive
array_walk_recursive($yourArray, function (&$value) { $value = html_entity_decode($value, ENT_QUOTES); });