I have an array $fields:
Array
(
[NAME] => M'y Na'me
)
I want to convert those apostrophes to entities. When I run:
array_map('htmlentities', &$fields, array_fill(0 , count($fields) , ENT_QUOTES) );
and then print_r $fields
nothing seems to have changed?
Array
(
[NAME] => M'y Na'me
)
How can I apply htmlentities with ENT_QUOTES
on all elements in $fields
?
EDIT: this makes me lose my keys
$fields = array_map('htmlentities', $fields, array_fill(0 , count($fields) , ENT_QUOTES) );