0

I'm working on an autocomplete function which retrieves JSON data as source (multidimensional array), the final $response after json_encode(); in the console is for example:

Object ->
   Array[3] ->
      [0] ->
         label: "Example label & etc."
         link: "examplelink.com"
         tag: "example tag"
         value: "Example label & etc."
      [1] ->
         label: "Example label 2 & etc."
         link: "examplelink 2.com"
         tag: "example tag 2"
         value: "Example label 2 & etc."
      [2] ->
         …

At one point, I'm not sure where, the ampersands got replaced by their HTML entities and I'd like to display them in their human-readable form as "&". If already looked at a couple of examples on how to decode-encode-whatcode HTML entities, but I couldn't get it to work and I'm not sure at which point the conversion should happen.

Can someone tell me the best practice to display the values (or only label) with converted characters?

Thanks!

R4ttlesnake
  • 1,661
  • 3
  • 18
  • 28
  • I think already have answer for this check here http://stackoverflow.com/questions/3346272/getting-json-encode-to-not-escape-html-entities – jamseernj Dec 04 '14 at 16:20
  • They will display as their character in the browser, where are you displaying that you would like to change it? – AbraCadaver Dec 04 '14 at 16:21

0 Answers0