Jump to content

[SOLVED] htmlentities and array_map


miless

Recommended Posts

I'm trying to htmlentities all the $_POSTs in my script (must be around 50) but I get this warning. The code works as intended but a warning appears if you set error reporting. Any idea how to fix it so there is no warning?

 

error_reporting(E_ALL | E_STRICT);

 

Warning:  htmlentities() expects parameter 1 to be string, array given in /path-to-file on line XX

 

$_POST = array_map("htmlentities", $_POST);

 

Link to comment
https://forums.phpfreaks.com/topic/164157-solved-htmlentities-and-array_map/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.