Belgin Fish
Belgin Fish

Reputation: 19837

Having different character formats PHP / Mysql

On my site i'm trying to get different character support for the searches, for example hebrew so something like

אייל גולן

but the thing is, when they make the search it's stored in the database like

#1488;#1497;#1497;#1500; #1490;#1493;#1500;#1503;

What should i do? Is there any way to convert that back to readable hebrew text? or should i find a way to store in the db properly.

Thanks

Upvotes: 0

Views: 91

Answers (2)

Revenant
Revenant

Reputation: 2984

Well, I wouldn't suggest going down to html_entity_decode(). I would use it as last solution. Make your page and database UTF-8 (character set and file if necessary).

Later if you are using any php built-in functions for html characters, make sure they allow UTF8 also.

This will make you code less and give you less headache.

Upvotes: 2

Calum
Calum

Reputation: 5316

html_entity_decode() could help you out.

Upvotes: 0

Related Questions