1

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);
RiggsFolly
  • 93,638
  • 21
  • 103
  • 149

3 Answers3

0

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);
Markus Zeller
  • 8,516
  • 2
  • 29
  • 35
0

This seems to do it...

    function myFunc($a) {
    return html_entity_decode($a, ENT_QUOTES);
    }

    $row = array_map("myFunc", $row);
-1

You can try with array_walk_recursive

array_walk_recursive($yourArray, function (&$value) { $value = html_entity_decode($value, ENT_QUOTES); });
urka_mazurka
  • 138
  • 1
  • 11