php - html_entity_decode() isn't working properly? -


edit: solved seconds after posting question (sorry!) can't accept answer yet.

hi folks,

just quick one. have php/codeigniter site , user can edit profile. i'm using ci's xss filtering , active record-based models, data escaped automatically.

it naturally displays fine on profile page view, text such "we'll see if works" (the apostrophe in we'll). when user goes edit page, input box (filled data in db) displays:

we'll see if works 

i thought around setting value of input box html_entity_decode($query->row('example_database_row')) still doesn't work. misunderstanding here?

thanks!

jack

you can use html_entity_decode($query->row('example_database_row'), ent_quotes).

however, advise against html encoding before insert database. encode when output it. it's better storing raw data in database.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -