0

I am trying to run an array_map (two, technically) on all values received from a $_POST variable, from a multiple select list.

Here's the code:

$culture = array_map('mysql_real_escape_string', array_map('html2txt', $_POST['culture[]']));

Should this work?

Ryan Schafer
  • 245
  • 2
  • 9
  • 16
  • 1
    Don't use `mysql_real_escape_string` to escape database values. It is not a secure solution. Instead, use parameterized queries. See my answer to this other question: http://stackoverflow.com/questions/8165500/efficiently-sanitize-user-entered-text/8169705#8169705 – Polynomial Nov 23 '11 at 15:48

1 Answers1

1

That code looks perfectly fine to me. That's the way to do consecutive array_map's.

Dogbert
  • 212,659
  • 41
  • 396
  • 397