sql - how to encode special character using php function -


my orginal text 1 1/2"w x 1/2"h , in database likes 1 1/2â€w x 1/2â€h.

i using stripslashes().

but still can't convert encrypted string.

thank

i added html.

<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 

i don't know read have use stripslashes() escape database input or output information wrong. have use specific escaping mechanism provided database library. instance, if using pdo can use bindvalue() inject values sql code.

as 1 1/2â€w x 1/2â€h, looks multi-byte utf-8 string misinterpreted single-byte encoding (possibly iso-8859-1). looks either trying fit utf-8 data latin1 database or providing wrong charset when connecting database. in first case, best solution changing db charset match application's charset (if dbms allows so). in second case, you'll find solution in php manual page whatever db library is: method specify charset or encoding of connection.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -