开发者

Having different character formats PHP / Mysql

开发者 https://www.devze.com 2023-02-27 03:08 出处:网络
On my site i\'m trying to get different character support for the searches, for example hebrew so something like

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;#149开发者_如何学Python7;#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


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.


html_entity_decode() could help you out.

0

精彩评论

暂无评论...
验证码 换一张
取 消