utils.php 324 B

12345678910111213141516
  1. <?php
  2. function html_escape_value($data)
  3. {
  4. if (!is_array($data)) {
  5. return htmlspecialchars($data, ENT_QUOTES, 'UTF-8', false);
  6. }
  7. $escapedData = array();
  8. foreach ($data as $key => $value) {
  9. $escapedData[html_escape_value($key)] = html_escape_value($value);
  10. }
  11. return $escapedData;
  12. }