-2

We have list of names with special characters such as

Jay O'Coney

Bryăn Parker

We would like it to be saved in the database and also fetch using AJAX.

Tried:

//php
Return Response::JSON(array('name' => htmlentities($name, ENT_COMPAT, "UTF-8")));

//in jquery
$('#name').html(html_entity_decode('Name: ' + name,ENT_COMPAT, "UTF-8"));

Thanks in advance

rfpdl
  • 956
  • 1
  • 11
  • 35

1 Answers1

-1

try with,

utf8_encode($string);
Ayyanar G
  • 1,545
  • 1
  • 11
  • 24