Hello people, I'm new in this forum, I hope be useful to you. ( my english is not good enough, but I'll do my best 😉 )
Now, I got a problem, and I don't know how to solve it...
I'm trying to use the funcion htmlspecialchars in an array using array_map. But I need to pass to htmlspecialchars some params, but I can't... I don't know how to do it 😕
This is what I have till now.
// ... code...
public function cleanData($data) {
// ... a little bit more of code D:...
$data = array_map('htmlspecialchars', $data, array(ENT_QUOTES));
return $data;
}
/// ... more code ....
If I do that, executes htmlspecialchars without problems, but ENT_QUOTES doesn't work.
Now, if I do this
$data = array_map('htmlspecialchars', $data, array(ENT_QUOTES, 'UTF-8'));
In that case, throw this error :
Warning: htmlspecialchars() expects parameter 2 to be long, string given
Thanks in advance...
See you .